Skip to content

Pin Node to 22.22.3 to fix firebase preview deploy auth#216

Merged
tamalsaha merged 2 commits into
masterfrom
fix-firebase-preview-auth
Jun 21, 2026
Merged

Pin Node to 22.22.3 to fix firebase preview deploy auth#216
tamalsaha merged 2 commits into
masterfrom
fix-firebase-preview-auth

Conversation

@tamalsaha

@tamalsaha tamalsaha commented Jun 21, 2026

Copy link
Copy Markdown
Member

Problem

The preview deploy job fails during Firebase authentication:

Error: Invalid response body while trying to fetch https://www.googleapis.com/oauth2/v4/token: Premature close
Error: Failed to authenticate, have you run firebase login?

The "Failed to authenticate" line is a misleading catch-all; the real error is the Premature close on the OAuth2 token fetch.

Root cause (verified)

A Node.js regressionnodejs/node#63989 — shipped in the same-day security releases Node 22.23.0 and 24.17.0. It breaks keep-alive socket reuse, which surfaces as ERR_STREAM_PREMATURE_CLOSE in node-fetch@2 — the transport used transitively by google-auth-librarygaxiosnode-fetch. The firebase service-account token exchange runs through exactly this path, so auth fails.

Key points:

  • Independent of the firebase-tools version — reproduced on firebase-tools 14.27 through 15.22.0 (see firebase/firebase-tools#10681, confirmed by a Firebase maintainer).
  • Known-good Node: 22.22.x or 24.16.x. Broken: 22.23.0, 24.17.0 (still the latest releases — no fixed-forward Node yet).
  • Our CI was running Node 22.23.0 (check-latest: true pulled the latest 22.x).

Fix

Pin actions/setup-node to 22.22.3 (latest known-good 22.x) and drop check-latest. Revert to check-latest/floating once a fixed Node release lands.

Fixes the failure in run 27901671685.

firebase-tools@latest (15.22.0) fails service-account authentication
with a 'Premature close' error when fetching the OAuth2 token, breaking
the preview deploy. Pin to a known-good release.

Signed-off-by: Tamal Saha <tamal@appscode.com>
kodiakhq[bot]
kodiakhq Bot previously approved these changes Jun 21, 2026
The preview deploy failed with 'Premature close' during firebase
service-account auth. Root cause is a Node.js regression
(nodejs/node#63989) shipped in Node 22.23.0 and 24.17.0, which breaks
keep-alive socket reuse in node-fetch -- the transport used by
google-auth-library/gaxios. It is independent of the firebase-tools
version. CI was running Node 22.23.0; pin to 22.22.3 (latest known-good)
until a fixed Node release lands.

Signed-off-by: Tamal Saha <tamal@appscode.com>
@tamalsaha tamalsaha changed the title Pin firebase-tools version in preview-website workflow Pin Node to 22.22.3 to fix firebase preview deploy auth Jun 21, 2026
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit adcbf09):

https://appscode-v3-hugo--pr216-fix-firebase-preview-dm879ai8.web.app

(expires Sun, 28 Jun 2026 11:16:53 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 1720b7810a846fabdac7ca3b944d0f3a577e94de

@tamalsaha tamalsaha merged commit f184b71 into master Jun 21, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant