Skip to content Skip to sidebar Skip to footer

Accessing Google Cloud Storage Bucket From Cloud Functions Throws 500 Error

I'm trying to access google cloud storage bucket from cloud functions (python) instance and it's throwing mystic 500 error. I have given the service account editor role too. It d

Solution 1:

The error you are getting it's because your Cloud Functions service account doesn't have the cloudfunctions.serviceAgent role. As you can see on the documentation:

Authenticating as the runtime service account from inside your function may fail if you change the Cloud Functions service account's permissions.

However, I found that sometimes you can not add this role as it doesn't show up as an option. I have reported this issue to the Google Cloud Functions engineering team and they are working to solve it.

Nevertheless, you can add the role again using thisgcloud command:

gcloud projects add-iam-policy-binding <project_name> --role=roles/cloudfunctions.serviceAgent --member=serviceAccount:service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com

Post a Comment for "Accessing Google Cloud Storage Bucket From Cloud Functions Throws 500 Error"