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?

Ahmed
  • 595
  • 4
  • 25

6 Answers6

7

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

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

cchiaramelli
  • 171
  • 2
  • 6
  • How do you downgrade the firebase version on CI? – margherita pizza Oct 07 '22 at 03:07
  • 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 https://hub.docker.com/r/andreysenov/firebase-tools) – cchiaramelli Oct 07 '22 at 03:44
2

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

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:

  • 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](/help/how-to-answer). – Community Oct 13 '22 at 01:55
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.

Samuel Bergström
  • 1,869
  • 1
  • 12
  • 8
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.

  • 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](/help/how-to-answer). – Community Feb 11 '23 at 23:22