firebase deploy error, Error: Failed to list functions for (project name)
Asked Answered
M

8

10

I am hosting my web application in Firebase and I have been deploying it with Gitlab CI/CD and it has been working just fine! But today for some reason I am getting this error when the pipeline is working

56Error: Failed to list functions for project-name

This is the command that I run in the pipeline

firebase deploy --only hosting --non-interactive --token $FIREBASE_TOKEN

This is the error I am getting

deploying hosting
50i  hosting[project-name]: beginning deploy...
51i  hosting[project-name]: found 39 files in dist/dev
52i  hosting: hashing files [34/39] (87%)
53i  hosting: upload complete
54✔  hosting[project-name]: file upload complete
55i  hosting[project-name]: finalizing version...
56Error: Failed to list functions for project-name

Kindly note that the command is working up to the point where it says "finalizing version..." then it stops.

What could be causing this error?

Morra answered 6/10, 2022 at 15:6 Comment(1)
Also having this issue.. Attempted to update Node version and refreshing the token, but none fixed itHoyos
I
7

My firebase tools version was 11.14.0. I changed that to 11.13.0. Installed this specific version through npm install -g [email protected]. After that, I could successfully deploy.

Impracticable answered 6/10, 2022 at 18:29 Comment(0)
H
3

Maybe it can help, but locally I have an old version of firebase CLI (9.2.2), and it is still working fine. I'll probably downgrade firebase CLI version on CI until this is fixed

Hoyos answered 6/10, 2022 at 18:27 Comment(2)
How do you downgrade the firebase version on CI?Velocipede
I'm using Gitlab CI which runs on Docker, and I'm using the andreysenov/firebase image to tun firebase-tools and Node.js. It means that on top of my script, I changed image: andreysenov/firebase-tools:latest to image: andreysenov/firebase-tools:11.13.0. The "11.13.0" is the tag, and the available tags can be found on the docker hub repository (For this example, it's here hub.docker.com/r/andreysenov/firebase-tools)Hoyos
D
2

Ok, think I solved this: run 'firebase init functions' BEFORE running 'firebase init hosting'. This worked for me.

Duffer answered 6/10, 2022 at 22:54 Comment(1)
The new version requires you to add functions in order to host it seems.Ancipital
O
0

after run 'firebase init functions' and then 'firebase deploy' ... I found it's paid required features ( as follow )

Error: Your project basichtml-eca09 must be on the Blaze (pay-as-you-go) plan to complete this command. Required API artifactregistry.googleapis.com can't be enabled until the upgrade is complete. To upgrade, visit the following URL:

Owing answered 7/10, 2022 at 3:23 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Fatimafatimah
P
0

I actually had the same problem. I tried everything. I got the deployment to work locally by downgrading firebase-tools to 1.13.0 BUT(!) using my deploy script as a github action still failed.

In case this is how you ended up on this thread: https://github.com/FirebaseExtended/action-hosting-deploy/issues/203#issuecomment-1127732956

Basically, Go to cloud.google.com click "IAM & Admin", look for the principal with "github-action", click edit (the pencil icon), click "add another role" add "cloud functions viewer" and hit "save".

Everything worked like a charm (with firebase-tools 11.14.0)

Note: I previously updated my firebase plan to "Blaze" instead of "spark" (as some recommend) but it didn't work. While adding the "cloud functions viewer" role in Google Cloud did the trick I can't be sure if it was not a combination of both.

Precatory answered 7/10, 2022 at 17:54 Comment(0)
B
0

I solved the same problem executing the command "firebase login". Apperently i was already logged in but it was usefull to solve the problem.

Burkholder answered 7/2, 2023 at 8:32 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Fatimafatimah
I
0

For me these steps solved it:

  1. firebase init functions, success
  2. firebase hosting, still fails
  3. firebase login, returns "already logged in"
  4. firebase hosting, success
Installation answered 30/5 at 9:33 Comment(0)
C
0

FWIW, in my case I encountered this error randomly despite successfully deploying several times earlier; I changed literally nothing at all and ran the same command again and the error didn't reappear. So it was a nondeterministic error where the solution was just to run it again.

Compression answered 4/9 at 5:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.