firebase / firebase/firebase-tools

firebase deploy exits 0 after "409 unable to queue the operation" (combined hosting+functions deploy silently doesn't release Hosting) — #6989 still reproduces on 15.15.0

Open
#10,661 8 comments 6 reactions 1 assignee Claimed by @IzaakGough View on GitHub
api: functions reproducible type: bug
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### Environment

Version: **firebase-tools 15.15.0** (already includes the #10253 fix shipped in 15.14.0)
OS / CI: GitHub Actions, Ubuntu 24.04

### Summary

This is the same class of bug as #6989 (closed, fixed by #10253 in 15.14.0), but it **still reproduces on 15.15.0**. #10253 only fixed one cause — a background-analytics ping timing out and crashing the error handler before it could set the non-zero exit code. The `409 unable to queue the operation` path is **not** covered.

In a **combined hosting + functions deploy**, the swallowed failure additionally means **Hosting is never released to the live channel**, while the command exits `0` and CI stays green — so the pipeline silently ships nothing and reports success.

### Steps to reproduce

1. Two CI pipelines deploy `functions:default` to the **same project** within a few seconds of each other (here: a `dev` workflow and a `staging` workflow, both targeting the same Firebase project).
2. Each runs a combined deploy:
```
firebase deploy --force --only hosting:main,hosting:patient,functions:default,firestore --project PROJECT_ID --debug
```
3. Cloud Functions returns `409 ABORTED` on a function the other deploy already has an operation in flight for.

### Observed behavior

```
⚠ functions: Request to https://cloudfunctions.googleapis.com/v2/projects/PROJECT_ID/locations/europe-west3/functions/?updateMask=... had HTTP Error: 409, unable to queue the operation
⚠ functions: failed to update function projects/PROJECT_ID/locations/europe-west3/functions/
[queue] Retrying task index 0
```

- The `firebase deploy` step **exits `0`** → GitHub Actions marks the deploy green.
- **Hosting was never released.** `firebase hosting:channel:list --site SITE_ID` shows the `live` channel's last release predating this deploy, and the live site kept serving the previous build. Files were uploaded (`file upload complete`) but the live channel pointer never moved.

### Expected behavior

A deploy that logs `failed to update function` and/or does not successfully release Hosting must exit **non-zero**, so CI fails loudly instead of silently shipping nothing.

### Notes

- Reproduces on 15.15.0, i.e. **after** the #10253 fix.
- Multiple users report the same exit-`0`-on-`409` behavior in #6989 (`ripperdoc`, `devth`, `nick-fields`), including the "two CI jobs running close together" trigger.
- Filing fresh since #6989 is closed as completed.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.