Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gsutil cors set command returns 403 AccessDeniedException

I'm following these instructions on how to set a CORS configuration on a Google Cloud Storage bucket and when I run the gsutil cors set command it returns the following error message:

AccessDeniedException: 403 The account for bucket "[REDACTED]" has been disabled.

For the record, I have access to the bucket. I have owner privileges for this project in the Developer Console. Running gsutil cp and gsutil ls work just fine.

Any ideas on what might be wrong here?

like image 749
Jake Bellacera Avatar asked Aug 07 '14 19:08

Jake Bellacera


2 Answers

I'm answering my question because I found the solution for this issue. I hope this helps anyone else who runs into this, because at the time there was little info on the web describing to how to solve this.

It turns out that my user account did not have "owner" access to the bucket. Here are the steps I took to grant myself access:

1) First, navigate to your project's Cloud Storage Browser in the Developer Console.

2) Once you see a listing of the buckets that are linked to your project, check the box next to the bucket(s) you'd like to modify the permissions for and then click the "Bucket Permissions" button.

step 2 image

3) Next, add your user account to the list of permitted users. Set the permission level to "owner". Click the "Save" button when you're done.

step 3 image

You should have access to the bucket now, which means you won't run into any 403 errors. If you are, you did not set the entity correctly or are using a different account when you authenticated with gsutil. Double-check your work and try again.

like image 183
Jake Bellacera Avatar answered Nov 11 '22 22:11

Jake Bellacera


Just providing another tip in case others find themselves in the same situation I did. Make sure to log in with the correct google account using gcloud auth login. This can be a tricky detail if there are multiple Google accounts.

like image 39
max pleaner Avatar answered Nov 11 '22 23:11

max pleaner