firebase / firebase/firebase-tools

hosting: deploy to live channel exits 1 with HTTP 400 "is the current active version" despite the release succeeding (15.22.3 regression)

Open
#10,730 9 comments 15 reactions 0 assignees View on GitHub
api: core api: hosting reproducible type: bug
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### [REQUIRED] Environment info

**firebase-tools:** 15.22.3 (regression — 15.22.1 does not exhibit this)

**Platform:** Ubuntu (GitHub Actions `ubuntu-latest` / ubuntu-24), Node.js 24.17.0. Non-interactive auth via a service account (`GOOGLE_APPLICATION_CREDENTIALS`).

### [REQUIRED] Test case

A Firebase Hosting project, deployed to the **live** channel in CI with service-account credentials:

```bash
export GOOGLE_APPLICATION_CREDENTIALS=service-account.json
firebase deploy --only hosting --project
```

(Also reproduces through `FirebaseExtended/action-hosting-deploy@v0` with `channelId: live`, since it shells out to `firebase-tools` internally.)

### [REQUIRED] Steps to reproduce

1. Install `firebase-tools@15.22.3`.
2. Run `firebase deploy --only hosting --project ` against a project where Hosting already has a live release (i.e. any second+ deploy).
3. Observe the upload + finalize succeed, the new version is **released to the live channel** (visible in the Firebase Console release history), and then the CLI issues a **second** release request for that same just-released version, which fails.

### [REQUIRED] Expected behavior

`firebase deploy --only hosting` exits `0` once the version is released to the live channel. (Older versions, e.g. 15.22.1, succeed; a no-op/“already current” release should be treated as success, not a hard error.)

### [REQUIRED] Actual behavior

The deploy **succeeds** — the new version becomes the live release (confirmed in the Firebase Console: a fresh version id is published each run) — but the CLI then errors and exits `1`:

```
=== Deploying to '***'...
i deploying hosting
i hosting[***]: beginning deploy...
i hosting[***]: found 192 files in dist
✔ hosting[***]: file upload complete
i hosting[***]: finalizing version...
✔ hosting[***]: version finalized
i hosting[***]: releasing new version...

<<< [apiv2][body] POST https://firebasehosting.googleapis.com/v1beta1/projects/-/sites/***/channels/live/releases {"error":{"code":400,"message":"Can't release to `projects/-/sites/***/channels/live`: supplied version `projects//sites/***/versions/` is the current active version.","status":"FAILED_PRECONDITION"}}

Error: Request to https://firebasehosting.googleapis.com/v1beta1/projects/-/sites/***/channels/live/releases?versionName=projects%2F%2Fsites%2F***%2Fversions%2F had HTTP Error: 400, Can't release to `projects/-/sites/***/channels/live`: supplied version `projects//sites/***/versions/` is the current active version.
```

Process exits with code 1. The reported version id differs on every run and **is** the one that just went live — so the command appears to attempt a redundant release of the version it already activated, then treats the `FAILED_PRECONDITION` ("already the current active version") as a fatal error. This breaks CI (non-zero exit) even though the deploy itself completed.

Contributor guide

Open the contributing guide

Research direction

Start with the `firebase deploy --only hosting --project ` entry point using firebase-tools 15.22.3 and a project that already has a live release. Trace the Hosting finalize and release requests, then verify that a deploy which has already activated the version exits 0 rather than failing on the redundant HTTP 400 response.

Written by the indexing model from the issue text.

Assessment

Tech stack
firebase, typescript
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.