Unable to connect to Google Drive starting 2022-01-21
See original GitHub issueDescribe the current behavior
Starting 2022-01-21 (this morning), I’ve been unable to connect Google Drive to a Colab notebook. Using drive._mount()
does not launch a new window for authorising access causing ValueError: mount failed: invalid oauth code
. This was working previously.
Using drive.mount()
does pop up a window however the auth token doesn’t appear to be propagated to Colab resulting in MessageError: Error: credential propagation was unsuccessful
Describe the expected behavior Should be able to connect to Google Drive from Colab.
What web browser you are using Chrome Version 97.0.4692.99 (Official Build) (64-bit) - All extensions disabled (except a password manager).
Additional context Link to a minimal, public, self-contained notebook that reproduces this issue.
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (3 by maintainers)
Use this code:
!apt-get install -y -qq software-properties-common python-software-properties module-init-tools !add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null !apt-get update -qq 2>&1 > /dev/null !apt-get -y install -qq google-drive-ocamlfuse fuse from google.colab import auth auth.authenticate_user() from oauth2client.client import GoogleCredentials creds = GoogleCredentials.get_application_default() import getpass !google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret} < /dev/null 2>&1 | grep URL vcode = getpass.getpass() !echo {vcode} | google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret} %cd /content !mkdir drive %cd drive !mkdir MyDrive %cd … %cd … !google-drive-ocamlfuse /content/drive/MyDrive
Thanks to @zechenli03
I’m having an identical issue since this morning, 2022-01-21, too. I’m using Colab Pro + and connecting to my own google drive. Both are of the same account. I was able to trigger the authorization link and auth code, as well as the input box using an additional line of code:
from google.colab import drive, auth, output auth.authenticate_user() drive._mount(‘/content/drive’)
However, this works once, throws an error “ValueError: mount failed: invalid oauth code”, and then on rerunning the code fails to load the launch link, window, input box, as described above. I’ve tried playing around with all possible combination of force_remount, use_metadata_server, and ephemeral boolean arguments.
I had at one point cleared the DNS cache, I’ve revoked privileges (after running the auth.authenticate_user() and oauth dance, despite the ValueError message, seen them reappear in my console), I’ve logged out of my google account and restarted browser, none of which provided a solution.