Repository navigation
fix: disable keep-alive on GoogleAuth transporter to avoid Premature … - #10717
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request disables 'keep-alive' in google-auth-library calls to prevent Premature close errors on certain Node versions. It exports noKeepAliveAgent from src/apiv2.ts and configures it in src/requireAuth.ts. The reviewer noted that setting transporterOptions directly in src/requireAuth.ts would overwrite existing transporter options, and suggested spreading config.clientOptions?.transporterOptions to preserve them.
…close errors ### Description Disables HTTP keep-alive on the transporter utilized by `google-auth-library` to fetch and exchange auth tokens (e.g. via WIF or ADC). This works around a Node.js keep-alive socket reuse regression shipped in security updates for Node 22.23.0 and Node 24.17.0 (referenced in nodejs/node#63989) which causes token exchange requests to fail with `Premature close`. Fixes #10716 ### Scenarios Tested Tested minimal reproduction script `scripts/repro.ts` under Node v24.17.0 using Application Default Credentials: - Verified it fails on v15.22.1 and v15.22.2 (without the fix) with a `Premature close` GaxiosError. - Verified it successfully passes after applying the fix, making the Google API call and receiving a standard API response. - Ran all fast unit tests (`npm run mocha:fast`) successfully.
joehan
force-pushed
the
fix/auth-keepalive-regression
branch
from
June 25, 2026 17:03
c67fccb to
83c1013
Compare
ajperel
approved these changes
Jun 25, 2026
ajperel
left a comment
Contributor
There was a problem hiding this comment.
Seems pretty straightforward fix to the Node regression. Thanks for quickly fixing CLI!
bkendall
pushed a commit
that referenced
this pull request
Jul 9, 2026
…close errors (#10717) ### Description Disables HTTP keep-alive on the transporter utilized by `google-auth-library` to fetch and exchange auth tokens (e.g. via WIF or ADC). This works around a Node.js keep-alive socket reuse regression shipped in security updates for Node 22.23.0 and Node 24.17.0 (referenced in nodejs/node#63989) which causes token exchange requests to fail with `Premature close`. Fixes #10716 ### Scenarios Tested Tested minimal reproduction script `scripts/repro.ts` under Node v24.17.0 using Application Default Credentials: - Verified it fails on v15.22.1 and v15.22.2 (without the fix) with a `Premature close` GaxiosError. - Verified it successfully passes after applying the fix, making the Google API call and receiving a standard API response. - Ran all fast unit tests (`npm run mocha:fast`) successfully.
bkendall
pushed a commit
that referenced
this pull request
Jul 9, 2026
…close errors (#10717) ### Description Disables HTTP keep-alive on the transporter utilized by `google-auth-library` to fetch and exchange auth tokens (e.g. via WIF or ADC). This works around a Node.js keep-alive socket reuse regression shipped in security updates for Node 22.23.0 and Node 24.17.0 (referenced in nodejs/node#63989) which causes token exchange requests to fail with `Premature close`. Fixes #10716 ### Scenarios Tested Tested minimal reproduction script `scripts/repro.ts` under Node v24.17.0 using Application Default Credentials: - Verified it fails on v15.22.1 and v15.22.2 (without the fix) with a `Premature close` GaxiosError. - Verified it successfully passes after applying the fix, making the Google API call and receiving a standard API response. - Ran all fast unit tests (`npm run mocha:fast`) successfully.
yuichi0301
pushed a commit
to yuichi0301/firebase-tools
that referenced
this pull request
Aug 16, 2026
…close errors (firebase#10717) ### Description Disables HTTP keep-alive on the transporter utilized by `google-auth-library` to fetch and exchange auth tokens (e.g. via WIF or ADC). This works around a Node.js keep-alive socket reuse regression shipped in security updates for Node 22.23.0 and Node 24.17.0 (referenced in nodejs/node#63989) which causes token exchange requests to fail with `Premature close`. Fixes firebase#10716 ### Scenarios Tested Tested minimal reproduction script `scripts/repro.ts` under Node v24.17.0 using Application Default Credentials: - Verified it fails on v15.22.1 and v15.22.2 (without the fix) with a `Premature close` GaxiosError. - Verified it successfully passes after applying the fix, making the Google API call and receiving a standard API response. - Ran all fast unit tests (`npm run mocha:fast`) successfully.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Disables HTTP keep-alive on the transporter utilized by
google-auth-libraryto fetch and exchange auth tokens (e.g. via WIF or ADC). This works around a Node.js keep-alive socket reuse regression shipped in security updates for Node 22.23.0 and Node 24.17.0 (referenced in nodejs/node#63989) which causes token exchange requests to fail withPremature close.Fixes #10716
Scenarios Tested
Wrote up a minimal reproduction script
scripts/repro.tsunder Node v24.17.0 using Application Default Credentials:Premature closeGaxiosError.