TPU VM access Cloud Storage forbidden when writing files and training model

158 views
Skip to first unread message

Daisy Wang

unread,
Mar 25, 2022, 10:10:13 AM3/25/22
to Google Cloud Developers
I would like to save my result to storage bucket when running python code on the tpu-vm, but I always failed. I guess maybe the permission is wrong. But I try to modify the IAM and ACL, it didn't work. Here is the error link. https://stackoverflow.com/questions/71603984/tpu-vm-access-cloud-storage-403-forbidden-when-writing-files

I might be stuck in an error loop, I even tried switching to run the python code under the account I created the project, instead of the default service account on tpu-vm, but it still failed. I also tried setting allUsers and granting storage admin permissions, but it still fails.

Here are some settings I make.
1. project iam access
2022-03-25 18-23-52 的屏幕截图.png
2. bucket iam access
2022-03-25 18-24-41 的屏幕截图.png
3. default acl access
2022-03-25 18-25-17 的屏幕截图.png

Cloud Storage provides two types of IAM unified access and ACL fine-grained access. Which access permission should I enable, and what role should I set for which account so that my tpu-vm can access Cloud Storage?
Do I need to configure any environment variables before executing the python code to train the model?
What command should I use or what should I do in the console? I just want to be able to write the results to Storage.

Looking for your reply. Thanks!


Message has been deleted

George (Cloud Platform Support)

unread,
Mar 25, 2022, 10:37:36 AM3/25/22
to Google Cloud Developers
Hello, 

You'll need to grant your service account the permissions listed on the "IAM permissions for Cloud Storage" page.
Reply all
Reply to author
Forward
0 new messages