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.

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.
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:
Impersonation needs the Service Account Token Creator role for your user on that account.
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:
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.
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.
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.

Run in your terminal to get started locally.
// 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.
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.
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.
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.
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.