question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to connect to Google Drive starting 2022-01-21

See original GitHub issue

Describe 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. image

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 image

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:closed
  • Created 2 years ago
  • Comments:17 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
RajdeepBorgohaincommented, Jan 21, 2022

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

2reactions
GHBTMcommented, Jan 21, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix common issues in Google Drive
Fix common issues in Google Drive · Step 1: Check your Internet connection · Step 2: Check your browser version · Step 3:...
Read more >
Why is my Google Drive™ resource unable to connect to ...
You can click the “Access Now,” “Free Access,” or “Open Resource” button to initiate the connection to your Google Drive account.
Read more >
9 Easy Ways to Fix Google Drive Upload Stuck Issue in 2022
Way 6: Check the Network Connection. If the above methods can still not handle Google Drive stuck on starting upload issue, you can...
Read more >
Google Drive - Tableau Help
Start Tableau and under Connect, select Google Drive. For a complete list of data connections, select More under To a Server. In the...
Read more >
Google Drive - Miro Help Center
To start adding files from Google Drive, you'll need to install the plugin and connect your Google Drive to Miro. ⚠️ Non-Admin users...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found