Skip to content

App Hosting: combined 'firebase deploy' exits 0 when the rollout fails #10947

Description

@A13k2

Environment

  • firebase-tools: 14.9.0
  • Node: 22 (GitHub Actions, ubuntu)
  • Command: npx firebase-tools deploy -m "..." --project <alias> -f (project deploys storage, firestore, functions, extensions and an App Hosting backend from local source)

Problem: firebase deploy exits 0 when the App Hosting rollout fails

When the App Hosting build fails during a combined firebase deploy, the CLI logs the failure but still prints Deploy complete! and exits 0:

i  apphosting: You may also track the rollout(s) at: ...
- Starting rollout(s) for backend(s) nextjs; this may take a few minutes. It's safe to exit now.
⚠  apphosting: Rollout for backend nextjs failed.
⬢  apphosting: Failed to build your app. Please inspect the build logs at https://console.cloud.google.com/cloud-build/builds;region=...

✔  Deploy complete!

src/deploy/apphosting/release.ts does throw a FirebaseError ("One or more rollouts failed...") when a rollout settles rejected, but that error evidently never propagates to the process exit code in a combined deploy — the run above came from CI, where the green exit code meant our pipeline continued and ran e2e tests against the previous (stale) revision.

Expected: a failed App Hosting rollout makes firebase deploy exit non-zero, like a failed functions or rules deploy does.

Related: hard-coded 25-minute rollout poller fails slow builds that succeed

src/apphosting/rollout.ts pins masterTimeout: 25 * 60 * 1000 for the rollout/build operation pollers. Our App Hosting builds occasionally take longer than 25 minutes; the CLI then reports the deploy as failed even though the rollout completes successfully a few minutes later. Combined with the bug above this makes the exit code unreliable in both directions for App Hosting. A flag to extend the timeout (or reusing the "It's safe to exit now" semantics with a --no-wait option plus a reliable waiting mode) would help CI use cases a lot.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions