All Google apps are unusable

I cannot access any Google app in Brave. I get the error:

This page isn’t working.
<webpage> redirected you too many times.

Try clearing your cookies.

ERR_TOO_MANY_REDIRECTS

This error is persistent. I have tried:

  • Clearing cookies and cache
  • Factory resetting browser
  • Using Incognito mode

…all to no avail. The same websites work flawlessly in Firefox and Chrome.

References (have tried all that apply to me with no success):

https://support.google.com/drive/thread/49085825/i-have-no-access-to-google-drive-it-says-redirected-you-too-many-times-i-cleaned-cache-etc?hl=en

https://support.google.com/chromebook/thread/17608433/having-drive-google-com-redirected-you-too-many-times-problem?hl=en

By ‘Google apps’ I figure you mean things like Docs, Sheets, Drive, etc.? What about Gmail, same thing?

What Linux OS/distro?

What version of Brave is it? How did you install it?

Do you have any extensions installed/enabled? If so, does it still happen with them all disabled?

Does the issue occur in a Private window?

Does the issue occur if you create a new profile and try it in that profile? (Make sure your original profile does not have any open windows; only the new profile should be open.)

Are you using ‘Secure DNS’ settings in Brave? What if you turn it off?

Is anything set in brave://flags ? (Anything with a non-default setting will be sorted to the top, and will have a blue dot next to it.)

I don’t use Gmail but will check.

On a regular basis I use Arch Linux and NixOS and I’ve had the problem on both. I’ve also had it on Windows when I’ve run it every once in a while. The problem is persistent on NixOS while it’s only intermittent on Arch.

Arch Linux Brave version: 1.32.133 (chromium 96.0.4664.45)
NixOS Brave version: same

The only extension I have is Lastpass and I’ve tried with it disabled to no avail.

Yes, the issue occurs with a private window and with a new profile.

Secure DNS is enabled but I believe that’s the default configuration. Let me try with it disabled.

In terms of flags, I’ve disabled the custom notifications on Arch. No flags are set on NixOS, though the binary is invoked with the necessary arguments to use Wayland (Ozone platform etc). I wouldn’t expect those to change anything, and I had the issue before adding them anyway.

Update: Gmail doesn’t work and disabling Secure DNS changed nothing.

I’ve seen this issue caused by a few different things including incorrect User Agent strings as well as Shields interactions w/ some websites. Are you using a VPN of any kind?

Also it seems so simple but can you test visiting these websites w/Shields down to see if it makes any difference?

I have tried disabling Shields (locally and globally), and I’m not using a VPN.

Currently I have one profile that can access it and another that can’t.

If I go Incognito in the profile that can’t access, it still can’t access. If I go Incognito in the profile that can access, it maintains access. (Both after logging in)

So what could differ between two extensionless, flagless Incognito sessions?

1 Like

The only thing I can think of off the top of my head is cookies/browsing data. But you stated that you’d cleared cache/cookies (for all time?) and also tried a “factory reset” of all data, correct?

Yes. On NixOS I had the error from the first page I opened. Additionally I’ve “factory resetted” (deleted the config and cache) many times. Sometimes it works for a few loads, but never more than that.

Grasping at straws a bit here, but any chance your clocks are significantly off? https://time.is/

Failing that, if it were my own system I’d probably want to look at a HAR capture but that can be somewhat intrusive, plus you have to figure out how to safely share the file. But it’s an option.

Or maybe something will jump out at you if you run it thru a HAR analyzer. At minimum we should at least be able to verify that there are indeed redirects being sent back by the web server. Then maybe screenshotting a couple of those instances from the HAR would be helpful on this thread.

Also, how did you install Brave?

Time is accurate.

Brave was installed via package manager on both Arch Linux and NixOS.

I’ll do the HAR capture.

HAR capture results:

There are indeed infinite redirects. It loops between https://accounts.google.com/ServiceLogin and https://docs.google.com/?pli=1.

Location header for odd-numbered entries (accounts.google.com):

Redirects from accounts.google.com to docs.google.com

Location header for even-numbered entries (docs.google.com):

OK thanks. What method did you use for removing cookies?

If we don’t figure it out by the weekend I can do an install of one of those distros and see if I can reproduce it. Probably go with NixOS as it’s more easily reproduced there, right?

First I removed cookies locally, by clicking the exclamation point (not a padlock interestingly) next to the URL, then going to Cookies (where it says “X in use”) and removed all the cookies in Allowed tab.

Then I removed cookies globally, in Settings > Privacy and security > Clear browsing data > Cookies and other site data.

Yes, I would say NixOS is more reproducible. Here’s the config. I’m using HomeManager.

home.nix

{ pkgs, ... }:
{
	programs.home-manager.enable = true;
	nixpkgs.overlays = [ import ./brave-overlay.nix ];
	home.packages = with pkgs; [
		brave
	];
}

brave-overlay.nix

_: super:
{
	brave = super.callPackage ./brave {
		withXorg = false;
		withWayland = true;
		commandLineArgs = "--ozone-platform=wayland --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer";
	};
}

brave/default.nix

{ stdenv, lib, fetchurl
, dpkg
, alsa-lib
, at-spi2-atk
, at-spi2-core
, atk
, cairo
, cups
, dbus
, expat
, fontconfig
, freetype
, gdk-pixbuf
, glib
, gnome2
, gnome
, gsettings-desktop-schemas
, gtk3
, libglvnd
, libpulseaudio
, libuuid
, libdrm
, libX11
, libXcomposite
, libXcursor
, libXdamage
, libXext
, libXfixes
, libXi
, libxkbcommon
, libXrandr
, libXrender
, libXScrnSaver
, libxshmfence
, libXtst
, mesa
, nspr
, nss
, pango
, pipewire
, udev
, xorg
, zlib
, xdg-utils
, wrapGAppsHook
, commandLineArgs ? ""
, withXorg ? true
, wayland
, withWayland ? false
}:
let
	rpath = lib.makeLibraryPath ([
		alsa-lib
		at-spi2-atk
		at-spi2-core
		atk
		cairo
		cups
		dbus
		expat
		fontconfig
		freetype
		gdk-pixbuf
		glib
		gnome2.GConf
		gtk3
		libdrm
		libglvnd
		libpulseaudio
		libuuid
		mesa
		nspr
		nss
		pango
		pipewire
		udev
		xdg-utils
		zlib
	] ++ [ # technically X11-specific, but required even with Ozone and Wayland
		libX11
		libXcomposite
		libxkbcommon
		libXdamage
		libXext
		libXfixes
		libXrandr
		libXcursor
		xorg.libxcb
	] ++ lib.optionals withXorg [
		libXScrnSaver
		libXi
		libXrender
		libxshmfence
		libXtst
	] ++ lib.optionals withWayland [
		wayland
	]);
in stdenv.mkDerivation rec {
	pname = "brave";
	version = "1.32.113";

	src = fetchurl {
		url = "https://github.com/brave/brave-browser/releases/download/v${version}/brave-browser_${version}_amd64.deb";
		sha256 = "PucDKfNPwos5LKzftdXR9Hkkf1UDzHULgyFIdjPiI4g=";
	};

	dontConfigure = true;
	dontBuild = true;
	dontPatchELF = true;
	doInstallCheck = true;

	nativeBuildInputs = [ dpkg wrapGAppsHook ];

	buildInputs = [ glib gsettings-desktop-schemas gnome.adwaita-icon-theme ];

	unpackPhase = "dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner";

	installPhase = ''
		runHook preInstall

		mkdir -p $out $out/bin

		cp -R usr/share $out
		cp -R opt/ $out/opt

		export BINARYWRAPPER=$out/opt/brave.com/brave/brave-browser

		# Fix path to bash in $BINARYWRAPPER
		substituteInPlace $BINARYWRAPPER \
				--replace /bin/bash ${stdenv.shell}

		ln -sf $BINARYWRAPPER $out/bin/brave

		for exe in $out/opt/brave.com/brave/{brave,chrome_crashpad_handler}; do
		patchelf \
				--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
				--set-rpath "${rpath}" $exe
		done

		# Fix paths
		substituteInPlace $out/share/applications/brave-browser.desktop \
				--replace /usr/bin/brave-browser-stable $out/bin/brave
		substituteInPlace $out/share/gnome-control-center/default-apps/brave-browser.xml \
				--replace /opt/brave.com $out/opt/brave.com
		substituteInPlace $out/share/menu/brave-browser.menu \
				--replace /opt/brave.com $out/opt/brave.com
		substituteInPlace $out/opt/brave.com/brave/default-app-block \
				--replace /opt/brave.com $out/opt/brave.com

		# Correct icons location
		icon_sizes=("16" "22" "24" "32" "48" "64" "128" "256")

		for icon in ''${icon_sizes[*]}
		do
				mkdir -p $out/share/icons/hicolor/$icon\x$icon/apps
				ln -s $out/opt/brave.com/brave/product_logo_$icon.png $out/share/icons/hicolor/$icon\x$icon/apps/brave-browser.png
		done

		# Replace xdg-settings and xdg-mime
		ln -sf ${xdg-utils}/bin/xdg-settings $out/opt/brave.com/brave/xdg-settings
		ln -sf ${xdg-utils}/bin/xdg-mime $out/opt/brave.com/brave/xdg-mime

		runHook postInstall
	'';

	preFixup = ''
		# Add command line args to wrapGApp.
		gappsWrapperArgs+=(--add-flags ${lib.escapeShellArg commandLineArgs})
	'';

	installCheckPhase = ''
		# Bypass upstream wrapper which suppresses errors
		$out/opt/brave.com/brave/brave --version
	'';

	passthru.updateScript = ./update.sh;

	meta = with lib; {
		homepage = "https://brave.com/";
		description = "Privacy-oriented browser for Desktop and Laptop computers";
		changelog = "https://github.com/brave/brave-browser/blob/master/CHANGELOG_DESKTOP.md";
		longDescription = ''
			Brave browser blocks the ads and trackers that slow you down,
			chew up your bandwidth, and invade your privacy. Brave lets you
			contribute to your favorite creators automatically.
		'';
		license = licenses.mpl20;
		maintainers = with maintainers; [ uskudnik rht jefflabonte nasirhm ];
		platforms = [ "x86_64-linux" ];
	};
}

If you have any trouble setting this up, I can probably help.

This is interesting.

Is it one of these or something else?

image

Does the issue occur on plain www.google.com as well, or just the ‘apps’ pages? If it does occur on www, can you share a screenshot of the drop-down under the ‘Not secure’ and then ‘Certificate’?

Unclear if it’s just failing validation due to the redirect issue.

I believe it’s just due to the redirect.

No visible way to view the certificate so I assume there isn’t one to show…

If only this would happen to every browser/user in the world and everybody would move away from Google for good, I think the world would suddenly become a much better place lol :grinning_face_with_smiling_eyes:

Hey @mattf , sorry, I completely ran out of time and never got back to this.

Are you still having this issue on latest (1.33.106) release?

If so, I’ll see if I can come up with any further ideas, although not sure if I’ll have cycles to set up a new distro VM. (I do have a Manjaro XFCE VM already, but I guess that’s not a surefire way to reproduce your intermittent issues on Arch.)

I haven’t run NixOS in a while (the computer with NixOS installed died sadly), and I haven’t had the issue on Arch Linux recently. Looks like someone fixed the issue—not sure who. Thanks for all the help!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.