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 functionsCommon 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
- Note which function region pair the CLI lists as failed.
- Read the specific error printed above the summary.
- Enable any API it names, or fix the build/runtime issue.
Terminal
firebase deploy --only functions:api --project my-project --debugEnable 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-projectHow 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
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…
Firebase "Failed to list functions" in CIFix Firebase "Error: Failed to list functions for X" in CI - the CLI could not query existing functions, usua…
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…