Score:2

Not Able To Access Google Cloud Bucket From VM?

cn flag

I am trying to transfer files from cloud bucket to VM. I am getting below error:

ServiceException: 401 Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object.

How to resolve this issue?

Score:1
mw flag

The user of service account you use do not have permissions to access the bucket and copy from it. Add roles "Storage Admin" or "Storage Object Admin" to the user you are trying to connect to the bucket.

Add role to a user: https://cloud.google.com/iam/docs/granting-changing-revoking-access#grant-single-role

Cloud Storage roles overview: https://cloud.google.com/storage/docs/access-control/iam-roles#standard-roles

Score:1
co flag

What I ended up doing, on my local machine (it is slightly different on Colab), was to create a Google Cloud service account. You can then do 2 things:

  • create a key for this service account that you then download on your VM, and set the path as export GOOGLE_APPLICATION_CREDENTIALS=<JSON_FILE_PATH>.
  • add roles to this service account so that it can read/write from the right buckets.

You can find more about it in the docs.

You then authenticate with this service account using gcloud auth activate-service-account --key-file=<JSON_FILE_PATH>.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.