-
Notifications
You must be signed in to change notification settings - Fork 857
fix: provide actionable error message for Drive mount credential failures #5805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: provide actionable error message for Drive mount credential failures #5805
Conversation
fischman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abdulwahabahmedkhanyusufzai I left Google & Colab years ago so I'm not an appropriate reviewer for this PR (and also I have no approval powers in this repo/org anymore).
That said, IMO this PR is misguided. The "credential propagation" exception can be raised for reasons other than third-party cookie blocking (e.g. Google Account Advanced Protection). I no longer have visibility into how the various down-stream systems interact in drive.mount() calls so don't have alternative suggestions.
google/colab/drive.py
Outdated
| ' - 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.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link is dead for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback and technical context, @fischman! I've updated the PR to:
Generalize the error message: Added 'Advanced Protection' as a potential cause for the propagation failure.
Update documentation link: Replaced the dead link with the active Colab FAQ section.
Since Ami is no longer with the team, tagging @blois and @colaboratory-team to take a look and potentially trigger the Security Scan. This fix helps clarify a common friction point for Brave and Safari users reported in #5798
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you forget to push an updated commit to the PR?
At any rate, although my opinion carries no weight anymore, IMO this PR is misguided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @fischman, thank you for the feedback. The updated commit is now visible—apologies for the delay in the push.
I understand that providing browser-specific troubleshooting might seem like a 'band-aid' rather than a deep architectural fix. My intent was to provide immediate, actionable guidance for users (specifically on Brave/Safari) who are currently facing silent failures, as seen in #5798.
If the team feels this text is too specific for the core library, I am happy to generalize it further. Otherwise, I hope this serves as a helpful stop-gap to reduce user friction while the underlying credential propagation logic is reviewed
|
Just a note for maintainers, AI-generated pull requests (code + responses) with a clear lack of efforts have become a very prevalent issue with PyTorch and it appears this has spread to other open-source projects |
Description
Overview
This PR improves the error handling in google.colab.drive.mount when the identity propagation handshake fails. Currently, when a browser blocks third-party cookies or cross-domain identity sharing (common in Brave, Firefox, or strict Chrome settings), the command fails with a cryptic MessageError: Error: credential propagation was unsuccessful.
This change catches that specific failure and provides the user with clear troubleshooting steps tailored to their browser.
Changes Implemented
Enhanced Error Handling: Wrapped the request_auth blocking request in a try...except block.
Context-Aware Advice: Added specific guidance for Brave (Shields), Chrome (Third-party cookies), and Safari (Cross-site tracking).
Documentation Link: Included a link to the official Colab FAQ for persistent issues.
Professional Re-raising: Used raise ... from e to ensure the original stack trace remains available for developers while providing a clean message for users.
Verification Results
Manual Testing: Verified that the RuntimeError is correctly raised with the new descriptive message when the MessageError contains the "credential propagation" string.
Regression Check: Verified that standard mount flows (where credentials are not blocked) remain unaffected.
Related Issue
Fixes #5798