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.
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 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
- Create
cors.jsonand apply it - Include
Content-TypeinresponseHeader - Test with
curl -I -H "Origin: https://app.example.com" ...
Detailed fix by platform
gcloud
gcloud storage buckets update gs://BUCKET --cors-file=cors.json
Code examples
cors.json
[{
"origin": ["https://app.example.com"],
"method": ["GET", "PUT", "POST"],
"responseHeader": ["Content-Type"],
"maxAgeSeconds": 3600
}]How to diagnose
- Origin — Exactly listed?
- Method/headers — Allowed?
- 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:
Similar errors
- 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
- 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
- Artifact Registry: Permission artifactregistry.repositories.uploadArtifacts denied Docker push: denied: Permission "artifactregistry.repositories.uploadArtifacts" denied on resource "projects/p/locations/l/repositories/r"
Most viewed in Google Cloud / Firebase
- Missing or insufficient permissions Firestore: FirebaseError: [code=permission-denied]: Missing or insufficient permissions
- Container failed to start Cloud Run: The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable
- Could not load the default credentials Google Cloud: Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 4 Nov 2026