Skip to content
Latchkey

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-project

Common 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

  1. Enable cloudfunctions.googleapis.com on the project.
  2. Grant the service account at least Cloud Functions Viewer (Admin to deploy).
  3. 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 --project id in every job.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →