firebase-tools: Storage rules deployment suddenly stopped working

[REQUIRED] Environment info

firebase-tools: 12.8.1

Platform: various

[REQUIRED] Test case

Unable to reproduce in a clean environment

[REQUIRED] Steps to reproduce

Run firebase deploy --only storage

[REQUIRED] Expected behavior

It deploys the storage rules

[REQUIRED] Actual behavior

[2023-12-04T20:09:56.726Z] > 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-04T20:09:56.727Z] > authorizing via signed-in user (bart@salesbuildr.com)
[2023-12-04T20:09:56.727Z] [iam] checking project msp-navigator-dev-3c0ae for permissions ["firebase.projects.get","firebaserules.releases.create","firebaserules.releases.update","firebaserules.rulesets.create"]
[2023-12-04T20:09:56.728Z] > refreshing access token with scopes: []
[2023-12-04T20:09:56.729Z] >>> [apiv2][query] POST https://www.googleapis.com/oauth2/v3/token [none]
[2023-12-04T20:09:56.729Z] >>> [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[2023-12-04T20:09:56.845Z] <<< [apiv2][status] POST https://www.googleapis.com/oauth2/v3/token 200
[2023-12-04T20:09:56.845Z] <<< [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[2023-12-04T20:09:56.885Z] >>> [apiv2][query] POST https://cloudresourcemanager.googleapis.com/v1/projects/msp-navigator-dev-3c0ae:testIamPermissions [none]
[2023-12-04T20:09:56.885Z] >>> [apiv2][(partial)header] POST https://cloudresourcemanager.googleapis.com/v1/projects/msp-navigator-dev-3c0ae:testIamPermissions x-goog-quota-user=projects/msp-navigator-dev-3c0ae
[2023-12-04T20:09:56.885Z] >>> [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/msp-navigator-dev-3c0ae:testIamPermissions {"permissions":["firebase.projects.get","firebaserules.releases.create","firebaserules.releases.update","firebaserules.rulesets.create"]}
[2023-12-04T20:09:57.072Z] <<< [apiv2][status] POST https://cloudresourcemanager.googleapis.com/v1/projects/msp-navigator-dev-3c0ae:testIamPermissions 200
[2023-12-04T20:09:57.072Z] <<< [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects/msp-navigator-dev-3c0ae:testIamPermissions {"permissions":["firebase.projects.get","firebaserules.releases.create","firebaserules.releases.update","firebaserules.rulesets.create"]}

=== Deploying to 'msp-navigator-dev-3c0ae'...

i  deploying storage 
Running command: npm run generate-storage-rules

> msp-navigator@0.0.0 generate-storage-rules
> node dist/apps/firestore-rules/main.js storage

✔  storage: Finished running predeploy script. 
[2023-12-04T20:09:57.377Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/msp-navigator-dev-3c0ae [none]
[2023-12-04T20:09:57.801Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/msp-navigator-dev-3c0ae 200
[2023-12-04T20:09:57.801Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/msp-navigator-dev-3c0ae {"projectId":"msp-navigator-dev-3c0ae","projectNumber":"284821635234","displayName":"MSP Navigator Dev","name":"projects/msp-navigator-dev-3c0ae","resources":{"hostingSite":"msp-navigator-dev-3c0ae","realtimeDatabaseInstance":"msp-navigator-dev-3c0ae","locationId":"europe-west"},"state":"ACTIVE","etag":"1_6170cb48-bee6-45f8-bfd1-c4dbd2ecc68f"}
[2023-12-04T20:09:57.802Z] Default storage bucket is undefined.


There was an issue deploying your functions. Verify that your project has a Google App Engine instance setup at https://console.cloud.google.com/appengine and try again. If this issue persists, please contact support.

Error: Your project is being set up. Please wait a minute before deploying again.

This problem started occurring for two projects at the same time. I’ve checked App Engine, it clearly states a default storage bucket is selected. I checked in the code and it’s expecting a key storageBucket in the resources object from the logs above, just before the error, but as you can see, it is not there.

Did anything change that could cause this to happen? I tried upgrading firebase-tools to the latest but it didn’t have an effect.

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Reactions: 24
  • Comments: 32 (4 by maintainers)

Most upvoted comments

May be related to: https://github.com/firebase/firebase-tools/issues/6162

Temporary fix: Downgrading firebase-tools to 11.22.0 (or any version that uses the http://appengine.googleapis.com/ api rather than the http://firebase.googleapis.com/ api to fetch the default storage bucket) worked for us

Hey everyone, sorry for the delayed updates here. Our team looked into this issue and rolled out a fix. Can anyone try deploying their storage rules via firebase deploy --only storage to see if you’d still encounter any errors? I tried it out using v12.9.1 no errors are being raised.

@anandsathe67, skipping Storage rules deployments should be fine. This should deploy your code and assets without modifying your Storage rules.

I am experiencing the same problem here. The stability issues with the Firebase platform have been increasing over the past few months, and I am seriously considering migrating to a different platform. Would appreciate the attention of the @Google team.

Hey all, gonna close this out for now since the issue has been resolved. For some context: the root cause of this was a backend change that went out too early. In the upcoming v13 of firebase-tools, we’ll be moving this call to use a new API that is more accurate. At some point in the coming months, we’ll need to roll out that backend change again. To avoid future issues, please upgrade to v13 ASAP when it is released.

If you’re coming back to this issue later and experiencing something similar, the best way forward is to upgrade to firebase-tools@>13.0.0 and try again.

Hey everyone, thanks for raising this and apologies for the issue this has caused. I’ve notified our team so that they can investigate what is causing this. I tried deploying using different versions of the Firebase CLI, and from what I can tell using v12.3.1 works.

@anandsathe67 you missed the part where it reports that there was an issue deploying “functions”, even tho this has nothing to do with deploying functions.

I’m also experiencing this. Downgrading to 11.30.0 worked for me.

Did a broken version of the http://firebase.googleapis.com/ get deployed somehow…?

Having the same problem since around 2am CET (nightly-build, no code changes), being on an europe-west3 resource location. Using firebase-tools 12.9.1

I get the error

i  deploying storage, firestore, functions

There was an issue deploying your functions. Verify that your project has a Google App Engine instance setup at https://console.cloud.google.com/appengine and try again. If this issue persists, please contact support.

Error: Your project is being set up. Please wait a minute before deploying again.

EDIT: I can also confirm, that with firebase tools v12.3.1 we are not facing the issue.

Same issue - wasted a few hours trying to figure it out. @aalej - could you also please request the fixer to change the error message ? Talk about completely confusing the user with these current messages:

project being set up ? Wait for a minute before deploying again (?) Verify that your project has a Google App Engine instance setup at https://console.cloud.google.com/appengine and try again (???) You can imagine the wild goose chase such messages put us through.

From src/gcp/storage.ts

export async function getDefaultBucket(projectId: string): Promise<string> {
try {
 const metadata = await getFirebaseProject(projectId);
 if (!metadata.resources?.storageBucket) {
   logger.debug("Default storage bucket is undefined.");
   throw new FirebaseError(
     "Your project is being set up. Please wait a minute before deploying again."
   );
 }
 return metadata.resources.storageBucket;
} catch (err: any) {
 logger.info(
   "\n\nThere was an issue deploying your functions. Verify that your project has a Google App Engine instance setup at https://console.cloud.google.com/appengine and try again. If this issue persists, please contact support."
 );
 throw err;
}
}

I can confirm this is happening to me as well!

@cedvdb in App Engine Console, go to Settings. It should say sth like this there:

Screenshot 2023-12-04 at 23 26 31

This confirms that despite the error message, there is in fact a default Cloud Storage bucket.

I can confirm this exact bug started today, and I also didn’t change anything, like @Burgov, with firebase-tools@^12.9.1. It was working last night, no changes, and now it doesn’t.