Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy fails due to "missing" default storage bucket #6162

Closed
bergeoisie opened this issue Jul 19, 2023 · 41 comments
Closed

Deploy fails due to "missing" default storage bucket #6162

bergeoisie opened this issue Jul 19, 2023 · 41 comments
Labels

Comments

@bergeoisie
Copy link

[REQUIRED] Environment info

firebase-tools: 12.4.4

Platform: Ubuntu

[REQUIRED] Test case

Not sure the best way to do this since it relates to the state of firebase/GCP project.

[REQUIRED] Steps to reproduce

Run firebase deploy

[REQUIRED] Expected behavior

Deploy succeeds.

[REQUIRED] Actual behavior

After attempting to upgrade our firebase-tools version from 11.18.0 to 12.4.4, our deploys fail with

[2023-07-13T05:49:06.671Z] 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.
1

It appears that the call to obtain the default storage bucket was changed in between those versions in #5973

I ran the calls locally to see the difference in output (redacting our project details). The old call:

 curl -X GET \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "x-goog-user-project: REDACTED" \
    "https://appengine.googleapis.com/v1/apps/REDACTED"

returns

{
  "name": "apps/REDACTED",
  "id": "REDACTED",
  "authDomain": "gmail.com",
  "locationId": "us-central",
  "codeBucket": "staging.REDACTED.appspot.com",
  "servingStatus": "SERVING",
  "defaultHostname": "REDACTED.uc.r.appspot.com",
  "defaultBucket": "REDACTED.appspot.com",
  "serviceAccount": "[email protected]",
  "gcrDomain": "us.gcr.io",
  "databaseType": "CLOUD_DATASTORE_COMPATIBILITY",
  "featureSettings": {
    "splitHealthChecks": true,
    "useContainerOptimizedOs": true
  }
}

versus the new call:

 curl -X GET \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "x-goog-user-project: REDACTED" \
    "https://firebase.googleapis.com/v1beta1/projects/REDACTED"

which returns a much smaller blob

{
  "projectId": "REDACTED",
  "projectNumber": "1234567890",
  "displayName": "REDACTED",
  "name": "projects/REDACTED",
  "resources": {
    "hostingSite": "REDACTED"
  },
  "state": "ACTIVE",
  "etag": "1_c080f4ba-b2da-4369-8f5f-b3a731257079"
}

It seems like these APIs might not actually be equivalent?

Thanks!

@aalej
Copy link
Contributor

aalej commented Jul 20, 2023

Hi @bergeoisie, thanks for reaching out and for sharing details about your observations! I’m trying to reproduce the issue you’re encountering but so far I haven’t encountered any issue while deploying.

From what I can gather, you’re trying to deploy your Firebase rules for Cloud Storage. Could you verify if you’ve initialized Cloud Storage for the project you’re trying to deploy to? Also, are you able to repro the issue in a fresh project?

@aalej aalej added the Needs: Author Feedback Issues awaiting author feedback label Jul 20, 2023
@bergeoisie
Copy link
Author

Hi @bergeoisie, thanks for reaching out and for sharing details about your observations! I’m trying to reproduce the issue you’re encountering but so far I haven’t encountered any issue while deploying.

From what I can gather, you’re trying to deploy your Firebase rules for Cloud Storage. Could you verify if you’ve initialized Cloud Storage for the project you’re trying to deploy to? Also, are you able to repro the issue in a fresh project?

Thanks for the quick response!

Yep, that's right. Our current firebase.json included a storage block that pointed to an v1 storage config. I wonder if that's the issue. It doesn't look like that's actually configuring firebase storage anymore? Since this is unused in our product, we're going to just remove the block. Deploys work after doing that. Thanks for the assistance!

@lox
Copy link

lox commented Aug 17, 2023

We are seeing this issue too.

firebase deploy --only storage --debug

[2023-08-17T12:50:11.183Z] 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.

Having trouble? Try firebase [command] --help

We absolutely have a default storage bucket setup, can verify in the appengine UI.

Our firebase.json has:

  "storage": {
    "rules": "rules/storage.rules"
  },

Which has

rules_version = '2';

// Craft rules based on data in your Firestore database
// allow write: if firestore.get(
//    /databases/(default)/documents/users/$(request.auth.uid)).data.isAdmin;
service firebase.storage {
  match /b/{bucket}/o {
    match /{userId}/{allPaths=**} {
      allow read, write: if request.auth != null && request.auth.uid == userId;
    }
  }
}

Strangely this works fine in our development project.

@cedvdb
Copy link

cedvdb commented Dec 4, 2023

@bergeoisie please reopen, removing the use of storage is not a fix.

Same issue here happens in github action deployment since today. I can see that the request to v1beta1 version is made as described above.

This happens when running:

firebase deploy --only storage --debug

@Jpoliachik
Copy link

Yup, also started seeing this issue as of today.

@bergeoisie bergeoisie reopened this Dec 4, 2023
@lucsande
Copy link

lucsande commented Dec 4, 2023

we have also started seeing the issue as of today. We made a successful deploy earlier today (around 10 AM GMT-03:00). But have not been capable of making new deploys in the last hour

@pangolinkeys
Copy link

pangolinkeys commented Dec 4, 2023

I'm also experiencing this issue
firebase-tools: 12.9.1
error: Default storage bucket is undefined.
Happens after this get rest req with the debug flag set:
[apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/{project-name}

@Azuka
Copy link

Azuka commented Dec 4, 2023

Just started seeing this today too. Did any of you upgrade (or have dependabot upgrade) google-github-actions/auth from v1 to v2? That seems to be the only CI change I'm seeing on my end.

Reverted, and that doesn't seem to be the issue. In my case, it works locally. I'll see if downgrading the firebase-tools version does it for CI.

@pangolinkeys
Copy link

Just started seeing this today too. Did any of you upgrade (or have dependabot upgrade) google-github-actions/auth from v1 to v2? That seems to be the only CI change I'm seeing on my end.

I've not made any dependency changes today failing both locally & ci.

@JWhite212
Copy link

Yup

Just started seeing this today too. Did any of you upgrade (or have dependabot upgrade) google-github-actions/auth from v1 to v2? That seems to be the only CI change I'm seeing on my end.

I've not made any dependency changes today failing both locally & ci.

I have also not changed anything, and as of today am getting the same issue.

@lhallowes
Copy link

me too, just started today.

@Russell-Pollari
Copy link

Same issue here, just noticed today

@yukioy1
Copy link

yukioy1 commented Dec 5, 2023

Same here, started today too a few hours ago

@appvisionco
Copy link

Same here

@andrewkrippner
Copy link

+1 deploys failing for me as well

@carlos-lara-dev
Copy link

Someone fix this ?

@unxavi
Copy link

unxavi commented Dec 5, 2023

Seeing this now in our 3 projects and trying to deploy from different machines

@remilefort
Copy link

same here

@kazukinagata
Copy link

Same here, downgraded to v11.30.0 and it worked.

@oyvindholmstad
Copy link

Same here as of today.

@sasos90
Copy link

sasos90 commented Dec 5, 2023

Same here.. what do we do now? Did they update something?

flqw added a commit to cleverlohn/firebase-deployment that referenced this issue Dec 5, 2023
@jawsandteeth
Copy link

ah.. so its not just me..

@xaphod
Copy link

xaphod commented Dec 5, 2023

Yay all our deploys are broken

@joerozek
Copy link

joerozek commented Dec 5, 2023

same problem here.

@j-wing
Copy link

j-wing commented Dec 5, 2023

We're seeing this also. We've filed a Google support ticket to get more attention on this, I'd encourage everyone here to do the same if you haven't already!

@aalej
Copy link
Contributor

aalej commented Dec 5, 2023

Hey everyone, apologies for the delay in updates here. Our team has investigated the issue and rolled out a fix. Could anyone try deploying their storage rules with firebase deploy --only storage to confirm if errors persist? I tested it on v12.9.1 and encountered no issues.

@joerozek
Copy link

joerozek commented Dec 5, 2023

Works again for me.

@Azuka
Copy link

Azuka commented Dec 5, 2023

Confirming it works for me again.

@joehan
Copy link
Contributor

joehan commented Dec 5, 2023

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.

@joehan joehan closed this as completed Dec 5, 2023
@jmw11x
Copy link

jmw11x commented Dec 5, 2023

I had this issue now too. aalej answer worked for me. People should confirm it works before this case is closed.

I have upgraded and the issue still persists I have an active support case on it and they agree it is a firebase issue.

They were unable to solve the problem BUT Firebase deploy only storage did fix the problem for me as well.

@6h4n3m
Copy link

6h4n3m commented Dec 5, 2023

Same here, no idea why this is being closed.... We're actively supporting an enterprise with our software and cannot deploy a hotfix that is halting operations because of this!

@jmw11x
Copy link

jmw11x commented Dec 5, 2023

Same here, no idea why this is being closed.... We're actively supporting an enterprise with our software and cannot deploy a hotfix that is halting operations because of this!

I thought it didn't work too. I upgraded etc even have support case..

I firebase deploy --only storage

Then firebase deploy WORKED no problem.

Also yesterday firebase deploy --only hosting worked as well. Only firebase deploy did not work.

Default storage bucket is undefined. is the error it takes place

from this code

apiv2][body] GET [https://firebase.googleapis.com/v1beta1/projects/yourprojectname

@joehan
Copy link
Contributor

joehan commented Dec 5, 2023

Apologies all, looks like I closed this preemptively. The backend fix is rolling out but may not have fully finished yet - reopening.

@joehan joehan reopened this Dec 5, 2023
@6h4n3m
Copy link

6h4n3m commented Dec 5, 2023

Same here, no idea why this is being closed.... We're actively supporting an enterprise with our software and cannot deploy a hotfix that is halting operations because of this!

I thought it didn't work too. I upgraded etc even have support case..

I firebase deploy --only storage

Then firebase deploy WORKED no problem.

Also yesterday firebase deploy --only hosting worked as well. Only firebase deploy did not work.

Thank you, I'll go try either of those.

@jmw11x
Copy link

jmw11x commented Dec 5, 2023

Same here, no idea why this is being closed.... We're actively supporting an enterprise with our software and cannot deploy a hotfix that is halting operations because of this!

I thought it didn't work too. I upgraded etc even have support case..
I firebase deploy --only storage
Then firebase deploy WORKED no problem.
Also yesterday firebase deploy --only hosting worked as well. Only firebase deploy did not work.

Thank you, I'll go try either of those.

firebase deploy --debug

will show you where it is failing if the issue persist

@fwadnjar
Copy link

fwadnjar commented Dec 9, 2023

#6162 (comment)

@joehan
Copy link
Contributor

joehan commented Dec 12, 2023

This issue has been resolved. Apologies for the disruption all!

@fwadnjar
Copy link

MesterPerfect:windows.PCSX2-1.6.0-10b500e4-e5c9-437e-a905-3c8d0cb81243

@fwadnjar
Copy link

#6561 (comment)

1 similar comment
@fwadnjar
Copy link

#6561 (comment)

@romaincoeur
Copy link

romaincoeur commented Mar 3, 2024

same here

Putain @remilefort je me prend la tête là dessus depuis hier !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests