Cloud Functions deploy: Could not upload source — storage bucket permission denied

The deploy can't stage the source ZIP in the gcf-sources bucket.

Exact message you may see Could not upload source to bucketAccessDeniedException: 403 does not have storage.objects.create accessgcf-sources bucket permission deniedCloud Functions deployment storage.buckets.get deniedBuild failed: could not stage source
Seen on: Google Cloud

Meaning

The Cloud Functions/Cloud Build service accounts need Storage permissions on the staging bucket (gcf-sources-*/gcf-artifacts), and the deploying user needs roles/storage.objectAdmin-level access. Check org policies, VPC-SC and that the bucket wasn't deleted.

Common causes

  • Deployer lacks storage permissions
  • Staging bucket deleted or recreated
  • Service agent missing bucket access
  • VPC-SC perimeter
  • Uniform access with missing IAM

⚡ Quick fix

  1. Grant storage roles to the deployer and service agents
  2. Recreate the staging bucket via a redeploy
  3. Check VPC Service Controls logs

Detailed fix by platform

Shell

  1. bash
    gcloud storage buckets list --filter="name~gcf-sources"
    gcloud storage buckets add-iam-policy-binding gs://BUCKET --member=user:you@example.com --role=roles/storage.objectAdmin

How to diagnose

  1. Bucket — Exists?
  2. IAM — Storage role?
  3. Perimeter — Blocking?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

403: does not have storage.objects.get access — Cloud Storage: 403 Forbidden — user@example.com does not have storage.objects.get access to the Google Cloud Storage object (Google Cloud / Firebase)403: does not have st…App Engine — App Engine deploy failed: invalid app.yaml (runtime not supported / entrypoint / handlers) (Google Cloud / Firebase)App EngineCannot find module — Cloud Functions: Error: Cannot find module 'X' (dependency missing at runtime) (Google Cloud / Firebase)Cannot find moduleCloud Functions: Build failed — Cloud Functions: Build failed: function.js does not exist / npm install failed with exit code 1 (Cloud Build step) (Google Cloud / Firebase)Cloud Functions: Buil…Eventarc — Cloud Functions (2nd gen) deploy failed: Eventarc trigger permission denied (Google Cloud / Firebase)EventarcModuleNotFoundError — Cloud Functions Python: ModuleNotFoundError: No module named 'X' (requirements.txt) (Google Cloud / Firebase)ModuleNotFoundErrorVPC-SC — Request is prohibited by organization's policy — VPC Service Controls perimeter violation (Google Cloud / Firebase)VPC-SCsource up…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.