Firebase "Failed to list functions" in CI
Before deploying, the CLI lists existing functions to compute a diff. That list call failed: the Cloud Functions API is disabled, or the identity lacks permission to view functions on the project.
What this error means
A functions deploy fails early with "Error: Failed to list functions for my-project" before any function is built or uploaded.
firebase
Error: Failed to list functions for my-projectCommon causes
The Cloud Functions API is not enabled
Without cloudfunctions.googleapis.com enabled, the list request returns an error the CLI surfaces as a list failure.
The service account cannot view functions
The identity lacks a role like Cloud Functions Viewer, so it cannot enumerate existing functions.
How to fix it
Enable the API and grant a viewer role
- Enable
cloudfunctions.googleapis.comon the project. - Grant the service account at least Cloud Functions Viewer (Admin to deploy).
- Re-run the deploy.
Terminal
gcloud services enable cloudfunctions.googleapis.com --project my-project
gcloud projects add-iam-policy-binding my-project \
--member="serviceAccount:ci@my-project.iam.gserviceaccount.com" \
--role="roles/cloudfunctions.admin"Confirm the project id
A wrong project id can also produce a list failure; verify it with firebase projects:list.
How to prevent it
- Enable required APIs before deploying functions in CI.
- Grant the CI service account roles to view and deploy functions.
- Pass the correct
--projectid in every job.
Related guides
Firebase "There was an error deploying functions" in CIFix Firebase "Error: There was an error deploying functions" in CI - the functions deploy aborted; the real r…
Firebase "HTTP Error: 403, The caller does not have permission" in CIFix Firebase "Error: HTTP Error: 403, The caller does not have permission" in CI - the identity authenticated…
Firebase "Functions did not deploy properly" in CIFix Firebase "Error: Functions did not deploy properly" in CI - one or more functions failed to build, provis…