Until yesterday (20 Jan) I could connect to another google drive account (using drive._mount), but when I tried this today, google colab showed me this error:
from google.colab import drive
drive._mount('/content/drive/')
/usr/local/lib/python3.7/dist-packages/google/colab/drive.py in _mount(mountpoint, force_remount, timeout_ms, use_metadata_server, ephemeral)
294 wrote_to_fifo = True
295 elif case == 5 and not use_metadata_server:
--> 296 raise ValueError('mount failed: invalid oauth code')
297 elif case == 6:
298 # Terminate the DriveFS binary before killing bash.
ValueError: mount failed: invalid oauth code
Strange thing is that error tells me "invalid oauth code", but not let me connect to google page and copy the code!
And I set use_metadata_server=True but this time, new error appeares:
from google.colab import drive
drive._mount('/content/drive/', use_metadata_server=True)
ValueError Traceback (most recent call last)
<ipython-input-5-42a561ce7057> in <module>()
1 from google.colab import drive
----> 2 drive._mount('/content/drive/', use_metadata_server=True)
/usr/local/lib/python3.7/dist-packages/google/colab/drive.py in _mount(mountpoint, force_remount, timeout_ms, use_metadata_server, ephemeral)
285 ': timeout during initial read of root folder; for more info: '
286 'https://research.google.com/colaboratory/faq.html#drive-timeout')
--> 287 raise ValueError('mount failed' + extra_reason)
288 elif case == 2:
289 # Not already authorized, so do the authorization dance.
ValueError: mount failed
Also I used drive.mount but showed pop-up and ask me to enter another account credentials. When I enter it, this error appears:
from google.colab import drive
drive.mount('/content/drive/')
MessageError Traceback (most recent call last)
<ipython-input-1-91874b305a32> in <module>()
1 from google.colab import drive
----> 2 drive.mount('/content/drive/')
3 frames
/usr/local/lib/python3.7/dist-packages/google/colab/_message.py in read_reply_from_input(message_id, timeout_sec)
104 reply.get('colab_msg_id') == message_id):
105 if 'error' in reply:
--> 106 raise MessageError(reply['error'])
107 return reply.get('data', None)
108
MessageError: Error: credential propagation was unsuccessful
I think this is new policy. Is there an solution?
this feature has been removed, you can now only mount a google drive from the same account of your notebook. https://github.com/googlecolab/colabtools/issues/2562#issuecomment-1017869732