Repository navigation
Closed
Labels
Description
[REQUIRED] Environment info
firebase-tools: 13.0.0
Platform: Ubuntu
[REQUIRED] Test case
I've started getting the following error when deploying to Firebase with the latest version (13.0.0):
Unexpected error when fetching default storage bucket.
Error: HTTP Error: 403, Permission 'firebasestorage.defaultBucket.get' denied on resource '//firebasestorage.googleapis.com/projects/myProjectId/defaultBucket' (or it may not exist).
Reverting to 12.9.1 works fine.
[REQUIRED] Steps to reproduce
firebase deploy --project myProjectId
[REQUIRED] Expected behavior
Should deploy without any errors like it used to with the previous version.
[REQUIRED] Actual behavior
firebase deploy --project myProjectId --debug
[2023-12-07T18:59:32.491Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2023-12-07T18:59:32.567Z] [iam] checking project myProjectId for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","datastore.indexes.create","datastore.indexes.delete","datastore.indexes.list","datastore.indexes.update","firebase.projects.get","firebaserules.releases.create","firebaserules.releases.update","firebaserules.rulesets.create"]
[2023-12-07T18:59:32.568Z] >>> [apiv2][query] POST [https://cloudresourcemanager.googleapis.com/v1/projects/myProjectId:testIamPermissions](https://cloudresourcemanager.googleapis.com/v1/projects/myProjectId:testIamPermissions) [none]
[2023-12-07T18:59:32.568Z] >>> [apiv2][(partial)header] POST [https://cloudresourcemanager.googleapis.com/v1/projects/myProjectId:testIamPermissions](https://cloudresourcemanager.googleapis.com/v1/projects/myProjectId:testIamPermissions) x-goog-quota-user=projects/myProjectId
[2023-12-07T18:59:32.568Z] >>> [apiv2][body] POST [https://cloudresourcemanager.googleapis.com/v1/projects/myProjectId:testIamPermissions](https://cloudresourcemanager.googleapis.com/v1/projects/myProjectId:testIamPermissions) ***"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","datastore.indexes.create","datastore.indexes.delete","datastore.indexes.list","datastore.indexes.update","firebase.projects.get","firebaserules.releases.create","firebaserules.releases.update","firebaserules.rulesets.create"]***
[2023-12-07T18:59:32.572Z] <<< [apiv2][status] GET https://firebase-public.firebaseio.com/cli.json 200
[2023-12-07T18:59:32.572Z] <<< [apiv2][body] GET https://firebase-public.firebaseio.com/cli.json ***"cloudBuildErrorAfter":1594252800000,"cloudBuildWarnAfter":1590019200000,"defaultNode10After":1594252800000,"minVersion":"3.0.5","node8DeploysDisabledAfter":1613390400000,"node8RuntimeDisabledAfter":1615809600000,"node8WarnAfter":1600128000000***
[2023-12-07T18:59:32.657Z] <<< [apiv2][status] POST [https://cloudresourcemanager.googleapis.com/v1/projects/myProjectId:testIamPermissions](https://cloudresourcemanager.googleapis.com/v1/projects/myProjectId:testIamPermissions) 200
[2023-12-07T18:59:32.658Z] <<< [apiv2][body] POST [https://cloudresourcemanager.googleapis.com/v1/projects/myProjectId:testIamPermissions](https://cloudresourcemanager.googleapis.com/v1/projects/myProjectId:testIamPermissions) ***"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","datastore.indexes.create","datastore.indexes.delete","datastore.indexes.list","datastore.indexes.update","firebase.projects.get","firebaserules.releases.create","firebaserules.releases.update","firebaserules.rulesets.create"]***
[2023-12-07T18:59:32.659Z] >>> [apiv2][query] POST [https://iam.googleapis.com/v1/projects/myProjectId/serviceAccounts/[email protected]:testIamPermissions](https://iam.googleapis.com/v1/projects/myProjectId/serviceAccounts/[email protected]:testIamPermissions) [none]
[2023-12-07T18:59:32.660Z] >>> [apiv2][body] POST [https://iam.googleapis.com/v1/projects/myProjectId/serviceAccounts/[email protected]:testIamPermissions](https://iam.googleapis.com/v1/projects/myProjectId/serviceAccounts/[email protected]:testIamPermissions) ***"permissions":["iam.serviceAccounts.actAs"]***
[2023-12-07T18:59:32.748Z] <<< [apiv2][status] POST [https://iam.googleapis.com/v1/projects/myProjectId/serviceAccounts/[email protected]:testIamPermissions](https://iam.googleapis.com/v1/projects/myProjectId/serviceAccounts/[email protected]:testIamPermissions) 200
[2023-12-07T18:59:32.748Z] <<< [apiv2][body] POST [https://iam.googleapis.com/v1/projects/myProjectId/serviceAccounts/[email protected]:testIamPermissions](https://iam.googleapis.com/v1/projects/myProjectId/serviceAccounts/[email protected]:testIamPermissions) ***"permissions":["iam.serviceAccounts.actAs"]***
=== Deploying to 'myProjectId'...
i deploying storage, firestore, functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> lint
> eslint --ext .js,.ts .
Running command: npm --prefix "$RESOURCE_DIR" run build
> build
> rm -rf ./lib && tsc --project tsconfig.build.json
✔ functions: Finished running predeploy script.
i storage: ensuring required API firebasestorage.googleapis.com is enabled...
[2023-12-07T18:59:50.326Z] >>> [apiv2][query] GET [https://serviceusage.googleapis.com/v1/projects/myProjectId/services/firebasestorage.googleapis.com](https://serviceusage.googleapis.com/v1/projects/myProjectId/services/firebasestorage.googleapis.com) [none]
[2023-12-07T18:59:50.326Z] >>> [apiv2][(partial)header] GET [https://serviceusage.googleapis.com/v1/projects/myProjectId/services/firebasestorage.googleapis.com](https://serviceusage.googleapis.com/v1/projects/myProjectId/services/firebasestorage.googleapis.com) x-goog-quota-user=projects/myProjectId
[2023-12-07T18:59:50.600Z] <<< [apiv2][status] GET [https://serviceusage.googleapis.com/v1/projects/myProjectId/services/firebasestorage.googleapis.com](https://serviceusage.googleapis.com/v1/projects/myProjectId/services/firebasestorage.googleapis.com) 200
[2023-12-07T18:59:50.601Z] <<< [apiv2][body] GET [https://serviceusage.googleapis.com/v1/projects/myProjectId/services/firebasestorage.googleapis.com](https://serviceusage.googleapis.com/v1/projects/myProjectId/services/firebasestorage.googleapis.com) [omitted]
✔ storage: required API firebasestorage.googleapis.com is enabled
[2023-12-07T18:59:50.602Z] >>> [apiv2][query] GET [https://firebasestorage.googleapis.com/v1alpha/projects/myProjectId/defaultBucket](https://firebasestorage.googleapis.com/v1alpha/projects/myProjectId/defaultBucket) [none]
[2023-12-07T18:59:50.750Z] <<< [apiv2][status] GET [https://firebasestorage.googleapis.com/v1alpha/projects/myProjectId/defaultBucket](https://firebasestorage.googleapis.com/v1alpha/projects/myProjectId/defaultBucket) 403
[2023-12-07T18:59:50.750Z] <<< [apiv2][body] GET [https://firebasestorage.googleapis.com/v1alpha/projects/myProjectId/defaultBucket](https://firebasestorage.googleapis.com/v1alpha/projects/myProjectId/defaultBucket) ***"error":***"code":403,"message":"Permission 'firebasestorage.defaultBucket.get' denied on resource '//firebasestorage.googleapis.com/projects/myProjectId/defaultBucket' (or it may not exist).","status":"PERMISSION_DENIED","details":[***"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"IAM_PERMISSION_DENIED","domain":"firebasestorage.googleapis.com","metadata":***"resource":"projects/myProjectId/defaultBucket","permission":"firebasestorage.defaultBucket.get"***]***
Unexpected error when fetching default storage bucket.
Error: HTTP Error: 403, Permission 'firebasestorage.defaultBucket.get' denied on resource '//firebasestorage.googleapis.com/projects/myProjectId/defaultBucket' (or it may not exist).
[2023-12-07T18:59:50.752Z] Error Context: ***
"body": ***
"error": ***
"code": 403,
"message": "Permission 'firebasestorage.defaultBucket.get' denied on resource '//firebasestorage.googleapis.com/projects/myProjectId/defaultBucket' (or it may not exist).",
"status": "PERMISSION_DENIED",
"details": [
***
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "IAM_PERMISSION_DENIED",
"domain": "firebasestorage.googleapis.com",
"metadata": ***
"resource": "projects/myProjectId/defaultBucket",
"permission": "firebasestorage.defaultBucket.get"
***
***
]
***
***,
"response": ***
"statusCode": 403
***
***
Error: Process completed with exit code 1.
Reacted by Thomas Bouillon, Luke Nelson, Jacek Nijaki, TangrisJones and Jack Joynson Software Limited
Activity
joehan commentedon Dec 7, 2023
Hey all - I've raised this to the Firebase Storage team and they are working on a fix ASAP. As an immediate workaround, I believe this permission is included in the
firebasestorage.viewerandfirebasestorage.adminroles - if you are running into issues, please try to grant one of those roles to the service account or user account that you are using.etienne-ditchlabs commentedon Dec 7, 2023
Ok thanks! The permission is in the documentation (https://firebase.google.com/docs/reference/rest/storage/rest/v1alpha/projects/getDefaultBucket) but not in IAM yet.
joehan commentedon Dec 8, 2023
Hey @etienne-ditchlabs, thanks for reporting this. It seems like what happened here the permissions were added to all the right roles, but we forgot to make them visible. They will still work, but can't be added to custom roles until we do so.
We removed the flag hiding this permission yesterday afternoon - unfortunately, for production safety reasons, IAM rollouts take a few days. We're going to update this issue once they are fully rolled out and available - until then, please use
firebasestorage.viewerorfirebasestorage.admin. Sorry for the inconvenience all!abhis3 commentedon Dec 11, 2023
Hi all, +1 to everything that Joe said above. The IAM team is slowly performing the rollouts, but looks like they have a small backlog they're working their way through, likely due to the various holiday freezes in place. We're working to see if we can expedite the process but this will likely end up being a waiting game, sorry for the inconvenience. I'll ping this bug with an update when the changes are available.
SimonKib commentedon Dec 12, 2023
@joehan Thanks, but adding either of the suggested permissions did not work me.
Only thing that changed was error message changing from
HTTP Error: 403, Permission 'firebasestorage.defaultBucket.get' denied on resourceto
HTTP Error: 403, The caller does not have permission, so the deployment still fails.
Here's the debug log.
I use the great "GitHub Actions for Firebase" and got deployment working again by downgrading to firebase-tools 12.9
jaceknijaki commentedon Dec 13, 2023
Same for me. Adding
Cloud Storage for Firebase Adminpermission just changed error message.As @SimonKib suggested, downgrade to firebase-tools 12.9 does the job while v13.0.1 is causing issues.
jaceknijaki commentedon Dec 19, 2023
@SimonKib Looks like setting both roles:
Cloud Storage for Firebase ViewerandStorage Admindid the job without firebase-tools downgrade.SimonKib commentedon Dec 19, 2023
Thanks @jaceknijaki. I did try that, but at that time it did not work for me.
bjosttveit commentedon Dec 23, 2023
Adding
Storage Adminworked for me 🥳abhis3 commentedon Jan 12, 2024
Hi all, to close the loop the
firebasestorage.defaultBucket.*permissions are now publicly visible on IAM, sorry again for the issue. Going to close this out but please feel free to reopen if there are still issues.balazserd commentedon Jun 28, 2025
I am hitting this error on the Firebase Console for Cloud Storage today - I see in the Network calls in the Developer Tools that the
defaultBucketAPI call is failing with this exact error, even though I am the owner of the Project in Cloud Console. As an owner I should have permission to anything.kdawgwilk commentedon Apr 29, 2026
I am using a custom role with
firebasestorage.defaultBucket.getpermission and this same 403 is happening. I also added theroles/firebasestorage.viewerbinding to the service account and it still gives a 403. Going to try the storage admin next but even if that works that is granting waay more permissions than should be required for this to work correctly. I think this issue should be reopenedkdawgwilk commentedon Apr 29, 2026
I ended up adding just these 2 permissions to my custom role instead of the storage admin role and its now working
storage.buckets.getstorage.buckets.listSo the docs are incorrect on the API here https://firebase.google.com/docs/reference/rest/storage/rest/v1alpha/projects/getDefaultBucket#iam-permissions
JamesJoyceGit commentedon Jun 16, 2026
I have just experienced this - my CICD was working fine, no upgrades - but something changed somewhere...
Adding the 2 permissions ("storage.buckets.get", "storage.buckets.list",) was not enough.
I also had to add "roles/firebasestorage.admin"
fix(deploy): the deploy account may read the Storage bucket's metadat…