firebase-tools: Failed to deploy to hosting with 'Failed to list functions for project' error

[REQUIRED] Environment info

firebase-tools: 11.14.0

Platform: macOS with M1 chip

[REQUIRED] Test case

I just updated firebase-tools from 11.13.0 to 11.14.0 and exec deploy command.

Then following error occurred.

$ firebase deploy

=== Deploying to 'project'...

i  deploying hosting
i  hosting[project]: beginning deploy...
i  hosting[project]: found 101 files in out
✔  hosting[project]: file upload complete
i  hosting[project]: finalizing version...

Error: Failed to list functions for project

[REQUIRED] Steps to reproduce

Same above.

[REQUIRED] Expected behavior

The deploy sequence will be completed.

[REQUIRED] Actual behavior

The error occurred.

Because I don’t use cloud functions, I think this is a bug.

Thank you.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 43
  • Comments: 25 (5 by maintainers)

Most upvoted comments

If someone need to fix it asap, you can reproduce what i did on my org forked version https://github.com/appchoose/action-hosting-deploy/commit/e63a636e6eaf0faa77f4844ff5f897baa2316bcf and then use your own version waiting for a fix on firebase side. (aka replace your workflow by - uses: appchoose/action-hosting-deploy@main). I do recommend to fork on your side and do not use mine.

Alright - I got this narrowed down and the PR above should fix it. We’ll get a build out today.

Thanks for the support @bkendall!

FYI- This regression broke several of our projects that I had set up with automatic github deploys using the https://firebase.google.com/docs/hosting/github-integration docs.

While I had a suspicion that the latest firebase-tools release was the cause, there was no trivial way to revert to a working version, since the github action always uses the latest version (https://github.com/FirebaseExtended/action-hosting-deploy/blob/0f248036885ae672f78587669fa2923f0ef6cac2/src/deploy.ts#L79).

And so our deploys have just been broken on multiple projects for 20+ hours. For comparison, we also use vercel for some of our projects, and it’s never had a hiccup on this order of magnitude.

I’ve opened https://github.com/FirebaseExtended/action-hosting-deploy/issues/242 to suggest that the github action pins to a known-good version of firebase-tools, but I’m curious if it would be feasible / reasonable to add some CI checks and/or pre-release checklist steps to firebase-tools that just test that “firebase deploy” works fine on a vanilla free firebase project?

Thank you kindly!

a simple workaround for me is I tried to downgrade to the previous version

npm uninstall -g firebase-tools npm install -g firebase-tools@11.13.0

and it works…

I notice others are seeing this when running firebase deploy, I thought it would be helpful to note that this also happens when specifically only trying to deploy to hosting. firebase deploy --only hosting

a simple workaround for me is I tried to downgrade to the previous version

npm uninstall -g firebase-tools npm install -g firebase-tools@11.13.0

and it works…

Awesome, this work for me too.

Thank you.

a simple workaround for me is I tried to downgrade to the previous version

npm uninstall -g firebase-tools npm install -g firebase-tools@11.13.0

Works for me too

I have no functions on this project - it is a very simple static site and I didn’t want to mess around with IAM creating permissions for something that doesn’t exist

I hope a fix will be out soon and I can upgrade again

We face the same issue when trying to deploy to Firebase Hosting on a PR or on merge using GitHub actions. The logs include the lines:

npm WARN exec The following package was not found and will be installed: firebase-tools@11.14.0
...
***
  "status": "error",
  "error": "HTTP Error: 403, Permission 'cloudfunctions.functions.list' denied on 'projects/<redacted>/locations/-/functions'"
***

@johnnyasantoss workaround for “failed to list functions” for me was to create Service Account with these roles:

Firebase Hosting Admin
Firebase Rules Admin
Firebase Authentication Admin
Cloud Datastore Index Admin
Cloud Functions Viewer
Cloud Run Viewer
API Keys Viewer 

and use serviceaccount.json path in GOOGLE_APPLICATION_CREDENTIALS env variable

debug log when it runned in Github Actions via FirebaseExtended/action-hosting-deploy

https://github.com/FirebaseExtended/action-hosting-deploy

[2022-10-06T02:04:03.522Z] [functions] HTTP Error: 403, Cloud Functions API has not been used in project XXXXXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudfunctions.googleapis.com/overview?project=XXXXXX then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.

It is also occurred from local Mac.