Nov 20, 20265 min read

Fix "does not have storage.objects.get access" on Google Cloud Storage

Why Cloud Storage returns 403 with "does not have storage.objects.get access to the Google Cloud Storage object", how to find the identity your code runs as, and which role to grant on which bucket.

Illustration for Fix "does not have storage.objects.get access" on Google Cloud Storage

Cloud Storage answers with 403 and sa-name@project.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object when the caller lacks permission to read that object. The message also adds (or it may not exist), so it does not reveal whether the object is there.

Start with the identity in the message, which is often a different account than the one you granted access to.

Access denied at a glance

CheckCommand or fix
Which identity is callingThe email in the error, or gcloud auth list locally
Does it have a role on the bucketgcloud storage buckets get-iam-policy gs://BUCKET
Is the role rightroles/storage.objectViewer for reads
Is the bucket on fine-grained ACLsCheck uniform bucket-level access
Did you grant it recentlyWait, propagation is typically 2 minutes
Does the client need bucket metadataAvoid get_bucket() or grant storage.buckets.get

Which identity is your code using?

The client libraries find credentials through Application Default Credentials. Locally that is usually your user account from gcloud auth application-default login, or a key file in GOOGLE_APPLICATION_CREDENTIALS. On Cloud Run, GKE and Compute Engine it is the attached service account, and if nobody set one, that is the Compute Engine default service account, PROJECT_NUMBER-compute@developer.gserviceaccount.com.

Code that works on your laptop therefore runs as you and fails in production as a service account nobody granted access to. To test as the production identity locally, impersonate it:

~
$ gcloud storage cat gs://acme-statements/c_481/2026-10.csv \ --impersonate-service-account=statements@acme-prod.iam.gserviceaccount.comERROR: (gcloud.storage.cat) HTTPError 403: statements@acme-prod.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object. Permission 'storage.objects.get' denied on resource (or it may not exist).

Impersonation needs the Service Account Token Creator role for your user on that account.

How do you grant read access?

Grant Storage Object Viewer on the bucket. It includes storage.objects.get and storage.objects.list, per the Cloud Storage IAM roles, and a bucket-level grant keeps the service away from every other bucket in the project:

~
$ gcloud storage buckets add-iam-policy-binding gs://acme-statements \ --member=serviceAccount:statements@acme-prod.iam.gserviceaccount.com \ --role=roles/storage.objectViewer

Role binding changes typically take 2 minutes and can take 7 or longer, and access granted through a Google group can take longer still. A retry right after granting is not proof the binding is wrong.

Why does it still fail after granting the role?

If the error persists with the role in place, check three things in turn. First, the bucket may use fine-grained access control, where the object's ACL is what is checked, while with uniform bucket-level access enabled only IAM applies, which is simpler to audit. Second, the code may call something that needs storage.buckets.get, which Object Viewer does not include. In Python, client.get_bucket(name) fetches bucket metadata, while client.bucket(name) makes no request:

from google.cloud import storage client = storage.Client() # Needs storage.buckets.get, which roles/storage.objectViewer lacks. # bucket = client.get_bucket("acme-statements") # Makes no request, so only storage.objects.get is checked on download. bucket = client.bucket("acme-statements") csv = bucket.blob("c_481/2026-10.csv").download_as_text()

Third, a VPC Service Controls perimeter or an IAM deny policy blocks the request. Those return different messages, such as Request is prohibited by organization's policy, so if the text differs from the one above, look there instead.

How does Encore grant bucket access?

Encore

Encore brings infrastructure from code: services declare the buckets they use in TypeScript, and Encore reads which services use each bucket and which operations they perform. When it provisions Cloud Storage in your GCP project, Encore provisions an IAM role for the service, a service account on GCP.

Application code passes through Encore and infrastructure guardrails to resources provisioned in your own AWS or GCP account.
Encore provisions the infrastructure your application needs in your own AWS or GCP account.
Get started
brew install encoredev/tap/encore &&
encore app create
Copy

Run in your terminal to get started locally.

~
$ encore app create statements-app --example=ts/hello-world$ cd statements-app && mkdir statements
// statements/statements.ts import { api, APIError } from "encore.dev/api"; import { Bucket, Downloader, ObjectNotFound } from "encore.dev/storage/objects"; // Cloud Storage on GCP, S3 on AWS, a local bucket under `encore run`. export const statements = new Bucket("customer-statements", { versioned: false }); // This service only downloads. Encore reads usage like this to work out // which services need which bucket permissions. const reader = statements.ref<Downloader>(); // Private: callable by other services in the app, not from the internet. export const get = api( { expose: false, method: "GET", path: "/statements/:customerId/:month" }, async ({ customerId, month }: { customerId: string; month: string }): Promise<{ csv: string }> => { try { const data = await reader.download(`${customerId}/${month}.csv`); return { csv: data.toString("utf8") }; } catch (err) { if (err instanceof ObjectNotFound) { throw APIError.notFound(`no statement for ${month}`); } throw err; } }, );

With an encore.service.ts file in statements/, encore run serves the endpoint against a local bucket. On deploy, the bucket becomes a Cloud Storage bucket in your project, as the GCP infrastructure docs describe, and there is no binding to forget when the service moves from your laptop to production. Deploys go to the project you connect to Encore.

A coding agent adding a service that downloads statements declares the reference in code and runs it locally in the same change, with no IAM binding in a separate repository for it to miss.

Best fit: Teams on GCP whose storage access errors come from bindings that drift away from what the code reads and writes.

Frequently asked questions

What does does not have storage.objects.get access mean?

The identity making the request has no role that includes storage.objects.get on the object's bucket or project, so Cloud Storage returns 403. The message names the identity, which is often a different service account than the one you granted access to.

Which role grants storage.objects.get?

roles/storage.objectViewer (Storage Object Viewer) grants storage.objects.get and storage.objects.list. Grant it on the bucket rather than the project to keep access narrow. It does not include storage.buckets.get.

Why do I get storage.buckets.get denied after granting Object Viewer?

Some client calls read bucket metadata first, such as get_bucket() in the Python client. Use client.bucket(name), which makes no request, then download the blob, or grant a role that includes storage.buckets.get if you need bucket metadata.

How does Encore grant services access to buckets?

Encore apps declare buckets in code, and Encore reads which services use each bucket and what operations they perform. Encore provisions an IAM role for the service, a service account on GCP.

Deploy to your cloud on AWS and Google Cloud
without managing infrastructure

Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.

~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders