gsutil cors set command returns 403 AccessDeniedException

只愿长相守 提交于 2019-12-19 19:47:37

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/25190365/gsutil-cors-set-command-returns-403-accessdeniedexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!