From e2334f9d43d10b817e8adc7d3ed52b50d161df0a Mon Sep 17 00:00:00 2001
From: Abdul Wahab Ahmed Khan
Date: Mon, 26 Jan 2026 10:58:20 +0000
Subject: [PATCH 1/3] fix: improve error messaging for Drive mount credential
failures (#5798)
---
google/colab/drive.py | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/google/colab/drive.py b/google/colab/drive.py
index f5f08703..4b4bd6c3 100644
--- a/google/colab/drive.py
+++ b/google/colab/drive.py
@@ -131,11 +131,23 @@ def _mount(
else _os.environ['TBE_CREDS_ADDR']
)
if ephemeral:
- _message.blocking_request(
- 'request_auth',
- request={'authType': 'dfs_ephemeral'},
- timeout_sec=int(timeout_ms / 1000),
- )
+ try:
+ _message.blocking_request(
+ 'request_auth',
+ request={'authType': 'dfs_ephemeral'},
+ timeout_sec=int(timeout_ms / 1000),
+ )
+ except Exception as e:
+ if 'credential propagation' in str(e).lower():
+ raise RuntimeError(
+ 'Drive mount failed because your browser is blocking Google credentials. '
+ 'Please check your browser settings:\n'
+ ' - If you use Brave: disable "Shields" for colab.research.google.com\n'
+ ' - If you use Chrome: allow third-party cookies for colab.research.google.com\n'
+ ' - If you use Safari: check that cross-site tracking is not disabled for this site\n'
+ 'See: https://support.google.com/colab/answer/13112095 for more details.'
+ ) from e
+ raise
mountpoint = _os.path.expanduser(mountpoint)
# If we've already mounted drive at the specified mountpoint, exit now.
From 0a3e40f5bad64149a763301ceba8ea6957213626 Mon Sep 17 00:00:00 2001
From: Abdul Wahab Ahmed Khan
Date: Mon, 26 Jan 2026 23:13:14 +0000
Subject: [PATCH 2/3] fix: generalize Drive mount error message and fix dead
link
---
google/colab/drive.py | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/google/colab/drive.py b/google/colab/drive.py
index 4b4bd6c3..4e326848 100644
--- a/google/colab/drive.py
+++ b/google/colab/drive.py
@@ -140,12 +140,14 @@ def _mount(
except Exception as e:
if 'credential propagation' in str(e).lower():
raise RuntimeError(
- 'Drive mount failed because your browser is blocking Google credentials. '
- 'Please check your browser settings:\n'
- ' - If you use Brave: disable "Shields" for colab.research.google.com\n'
- ' - If you use Chrome: allow third-party cookies for colab.research.google.com\n'
- ' - If you use Safari: check that cross-site tracking is not disabled for this site\n'
- 'See: https://support.google.com/colab/answer/13112095 for more details.'
+ 'Credential propagation was unsuccessful. This may happen if third-party cookies \n'
+'are blocked by your browser or if your account has Advanced Protection enabled.\n\n'
+'Common troubleshooting steps:\n'
+' - Brave: disable "Shields" for colab.research.google.com\n'
+' - Chrome: allow third-party cookies for colab.research.google.com\n'
+' - Safari: disable "Prevent Cross-Site Tracking"\n'
+' - Account: check if "Advanced Protection" is enabled for your Google Account.\n'
+'See: https://research.google.com/colaboratory/faq.html#drive-timeout for more details.'
) from e
raise
From 98a37942ad6989acdf15c639440129c7f18b6a15 Mon Sep 17 00:00:00 2001
From: Abdul Wahab Ahmed Khan
Date: Tue, 27 Jan 2026 08:05:49 +0000
Subject: [PATCH 3/3] fix: improve error message for credential propagation
issues during Drive mount
---
google/colab/drive.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/google/colab/drive.py b/google/colab/drive.py
index 4e326848..82782d47 100644
--- a/google/colab/drive.py
+++ b/google/colab/drive.py
@@ -137,17 +137,17 @@ def _mount(
request={'authType': 'dfs_ephemeral'},
timeout_sec=int(timeout_ms / 1000),
)
- except Exception as e:
+ except Exception as e:
if 'credential propagation' in str(e).lower():
raise RuntimeError(
'Credential propagation was unsuccessful. This may happen if third-party cookies \n'
-'are blocked by your browser or if your account has Advanced Protection enabled.\n\n'
-'Common troubleshooting steps:\n'
-' - Brave: disable "Shields" for colab.research.google.com\n'
-' - Chrome: allow third-party cookies for colab.research.google.com\n'
-' - Safari: disable "Prevent Cross-Site Tracking"\n'
-' - Account: check if "Advanced Protection" is enabled for your Google Account.\n'
-'See: https://research.google.com/colaboratory/faq.html#drive-timeout for more details.'
+ 'are blocked by your browser or if your account has Advanced Protection enabled.\n\n'
+ 'Common troubleshooting steps:\n'
+ ' - Brave: disable "Shields" for colab.research.google.com\n'
+ ' - Chrome: allow third-party cookies for colab.research.google.com\n'
+ ' - Safari: disable "Prevent Cross-Site Tracking"\n'
+ ' - Account: check if "Advanced Protection" is enabled for your Google Account.\n'
+ 'See: https://colab.research.google.com/notebooks/io.ipynb for more details.'
) from e
raise