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?
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.
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.
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.
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.