Skip to content
Latchkey

Firebase "There was an error deploying functions" in CI

The CLI reports the functions deploy operation failed as a whole. This wrapper message follows a more specific failure (build, quota, permission, or API not enabled) printed just above it.

What this error means

A functions deploy ends with "Error: There was an error deploying functions" after one or more operations reported an error.

firebase
Functions deploy had errors with the following functions:
	api(us-central1)
Error: There was an error deploying functions

Common causes

A required API is not enabled

Cloud Functions, Cloud Build, or Artifact Registry APIs must be enabled on the project; a disabled API fails the operation.

A build or runtime failure on a specific function

A compile error, a bad runtime config, or a startup crash on one function propagates to this operation-level error.

How to fix it

Read the named function and its error

  1. Note which function region pair the CLI lists as failed.
  2. Read the specific error printed above the summary.
  3. Enable any API it names, or fix the build/runtime issue.
Terminal
firebase deploy --only functions:api --project my-project --debug

Enable the required Google APIs

Enable Cloud Functions, Cloud Build, and Artifact Registry so provisioning can complete.

Terminal
gcloud services enable cloudfunctions.googleapis.com \
  cloudbuild.googleapis.com artifactregistry.googleapis.com --project my-project

How to prevent it

  • Enable the functions-related APIs before the first CI deploy.
  • Grant the service account roles for Cloud Build and Artifact Registry.
  • Reproduce build failures locally before deploying.

Related guides

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