CORS: No Access-Control-Allow-Origin (Cloud Storage) Google Cloud / Firebase Origin: Platform & cloud Last updated 4 Nov 2026

Browser: Access to fetch at 'https://storage.googleapis.com/bucket/file' from origin 'https://app.example.com' has been blocked by CORS policy

A browser upload/download to Cloud Storage was blocked because the bucket's CORS configuration doesn't allow your origin, method or headers.

Exact message you may see Access to fetch at 'https://storage.googleapis.com has been blocked by CORS policyblocked by CORS policy Cloud Storage bucketNo 'Access-Control-Allow-Origin' header is present on the requested resource storage.googleapis.comCORS preflight Google Cloud Storage
Seen on: Google Cloud

Meaning

Set a CORS policy on the bucket with the exact origin, methods (including OPTIONS preflight needs) and responseHeader entries such as Content-Type. Apply with gcloud storage buckets update --cors-file. Mind that CORS applies to the XML/JSON API endpoints you actually call, and can be cached for maxAgeSeconds.

Common causes

  • No CORS config on the bucket
  • Origin not listed (http vs https, trailing slash, port)
  • Required headers missing in responseHeader
  • Method not allowed (PUT, POST)
  • Cached old CORS response

⚡ Quick fix

  1. Create cors.json and apply it
  2. Include Content-Type in responseHeader
  3. Test with curl -I -H "Origin: https://app.example.com" ...

Detailed fix by platform

gcloud

  1. gcloud storage buckets update gs://BUCKET --cors-file=cors.json

Code examples

cors.json

json
[{
  "origin": ["https://app.example.com"],
  "method": ["GET", "PUT", "POST"],
  "responseHeader": ["Content-Type"],
  "maxAgeSeconds": 3600
}]

How to diagnose

  1. Origin — Exactly listed?
  2. Method/headers — Allowed?
  3. Cache — maxAge?

🔧 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…API has not been used in project before or it is disabled — Google Cloud: 403 SERVICE_DISABLED — Cloud Resource Manager API has not been used in project 123456 before or it is disabled. Enable it by visiting (Google Cloud / Firebase)API has not been used…Artifact Registry: Permission artifactregistry.repositories.uploadArtifacts denied — Docker push: denied: Permission "artifactregistry.repositories.uploadArtifacts" denied on resource "projects/p/locations/l/repositories/r" (Google Cloud / Firebase)Artifact Registry: Pe…FailedMount — Pod stuck ContainerCreating: MountVolume.SetUp failed / Unable to attach or mount volumes: timed out waiting for the condition (Kubernetes)FailedMountINSTALL_FAILED_INSUFFICIENT_STORAGE — INSTALL_FAILED_INSUFFICIENT_STORAGE: Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE] (Android)INSTALL_FAILED_INSUFF…Multi-Attach error — Multi-Attach error for volume: Volume is already exclusively attached to one node and can't be attached to another (Kubernetes)Multi-Attach errorNoSuchBucket / 404 The specified bucket does not exist — Cloud Storage: 404 Not Found — The specified bucket does not exist / No such object: bucket/object (Google Cloud / Firebase)NoSuchBucket / 404 Th…PVC Pending — PersistentVolumeClaim stuck in Pending (no persistent volumes available / waiting for first consumer) (Kubernetes)PVC PendingCORS: No …

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.