Skip to content

fix(deps): scope gaxios ^8.3.0 overrides to compatible major versions - #9617

Merged
ohmayr merged 1 commit into
mainfrom
fix/gcp-metadata-gaxios-override
Oct 16, 2026
Merged

ohmayr merged 1 commit into
mainfrom
fix/gcp-metadata-gaxios-override

Conversation

@ohmayr

@ohmayr ohmayr commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Context & Problem

PR #9569 added unscoped "gcp-metadata>gaxios": "^8.3.0" and "google-auth-library>gaxios": "^8.3.0" entries to pnpm.overrides in the root package.json. This forced older transitive versions ([email protected] and 4.3.1, pulled in by @google-cloud/[email protected] via [email protected] in handwritten/bigquery and @google-cloud/opentelemetry-resource-util) onto [email protected].

In gaxios >= 7.0.0, res.headers is a Fetch Headers instance (res.headers.get('Metadata-Flavor')), whereas gcp-metadata < 7.0.0 accesses res.headers['metadata-flavor'] as a plain object (undefined on a Headers instance), causing GCE metadata server requests in system tests (such as bigquery-system-tests) to fail with:
Error: Invalid response from metadata service: incorrect Metadata-Flavor header. Expected 'Google', got no header

Summary of Changes

  • Scope the root package.json pnpm.overrides to "gcp-metadata@>=8.0.0>gaxios": "^8.3.0" and "google-auth-library@>=10.0.0>gaxios": "^8.3.0" so major versions designed for Fetch Headers continue resolving [email protected], while older transitive [email protected]/6.x and [email protected]/9.x resolve their compatible [email protected]/6.x dependencies.
  • Regenerate pnpm-lock.yaml.

Verification

Scope the root pnpm.overrides for gcp-metadata>gaxios and
google-auth-library>gaxios to gcp-metadata@>=8.0.0 and
google-auth-library@>=10.0.0.

Unscoped overrides forced transitive [email protected] and 4.3.1
(pulled in by @google-cloud/[email protected] via
[email protected]) onto [email protected]. In gaxios >= 7.0.0,
res.headers is a Fetch Headers instance rather than a plain object,
causing gcp-metadata < 7.0.0 to read res.headers['metadata-flavor'] as
undefined and fail GCE metadata lookups with "incorrect Metadata-Flavor
header. Expected 'Google', got no header".
@ohmayr
ohmayr requested a review from a team as a code owner October 13, 2026 20:49

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the pnpm.overrides in package.json to apply the gaxios dependency override only to specific version ranges of gcp-metadata (>=8.0.0) and google-auth-library (>=10.0.0). There are no review comments, and I have no feedback to provide.

@ohmayr
ohmayr merged commit d468f3e into main Oct 16, 2026
46 checks passed
@ohmayr
ohmayr deleted the fix/gcp-metadata-gaxios-override branch October 16, 2026 01:06
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.

2 participants