Reputation: 41089
I was in the process of syncing a folder with 130k files to Google Cloud Storage. After several thousand images have been uploaded, I started to get the following message for each file that gsutil was trying to copy:
Your "Oauth 2.0 User Account" credentials are invalid. For more help, see "gsutil help creds", or re-run the gsutil config command (see "gsutil help config").
Failure: unauthorized_client.
I tried every trick I could think of. gcloud auth login
works as usual, but it does not resolve the problem. gcloud auth list
shows correct account. gsutil config
warns me that it is no longer necessary - I ran it anyway, and it worked as expected, but it did not solve the problem. Deleting .boto
file and running gsutil config
again did not help either.
At this moment I thought that may be I ran into some quota limit. I could not find any references in the documentation or on Cloud Console about any quota on file uploads. To verify this theory I tried to sync the same files from a different computer. And it worked, suggesting that there is no bucket or app quota. After a few thousand files, however, the second computer started showing the same error messages.
Another important note. Initially I tried to copy files using the Cloud Console, but it was going too slowly. Still, the console was able to upload more than 25k files - significantly more than gsutil
tool. I terminated this upload myself (25k very small files in 24 hours is too slow...)
Does anyone know what this is happening? And how can I restore the credentials now?
Upvotes: 5
Views: 2808
Reputation: 6185
I had the same error and I solved it by running gsutil config
.
This creates a new .boto
with new credentials.
Upvotes: 0
Reputation: 12145
this problem should now be fixed if your run:
gsutil update
(which will get you to gsutil v4.2)
Thanks for your patience.
Upvotes: 1
Reputation: 421
In case this is helpful to anyone, I had the same problem but Andrei's exact solution did not work for me. What worked was reinstalling boto via pip (pip install boto
) and then updating gcloud components (sudo gcloud components update
).
(Then running gcloud auth login
was not necessary).
Upvotes: 0
Reputation: 41089
The solution is to install boto release 2.29.1 (thanks, Mike Schwartz), and then update gcloud.
Install boto via pip:
$ pip install boto
Or install boto from source:
$ git clone git://github.com/boto/boto.git
$ cd boto
$ python setup.py install
Reinstall gcloud:
curl https://sdk.cloud.google.com | bash
~./google-cloud-sdk/install.sh
Fortunately, gcloud performs in place update, so it's relatively fast. Finally,
gcloud auth login
Upvotes: 0