Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gsutil returns "Unauthorized client"

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?

like image 754
Andrei Volgin Avatar asked Nov 10 '22 07:11

Andrei Volgin


1 Answers

this problem should now be fixed if your run:

gsutil update

(which will get you to gsutil v4.2)

Thanks for your patience.

like image 144
Mike Schwartz Avatar answered Dec 05 '22 06:12

Mike Schwartz