-
Notifications
You must be signed in to change notification settings - Fork 231
Installer and self-update ignore token env vars for GitHub release lookup #1582
Copy link
Copy link
Closed
Labels
area/cliCLI command surface, flags, help text (cross-cutting).CLI command surface, flags, help text (cross-cutting).priority/highShips in current or next milestoneShips in current or next milestonestatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/shepherdingActively being driven by an APM shepherd runActively being driven by an APM shepherd runstatus/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/securitySecure by default. Content scanning, lockfile integrity, MCP trust boundaries.Secure by default. Content scanning, lockfile integrity, MCP trust boundaries.type/bugSomething does not work as documented.Something does not work as documented.
Metadata
Metadata
Assignees
Labels
area/cliCLI command surface, flags, help text (cross-cutting).CLI command surface, flags, help text (cross-cutting).priority/highShips in current or next milestoneShips in current or next milestonestatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/shepherdingActively being driven by an APM shepherd runActively being driven by an APM shepherd runstatus/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/securitySecure by default. Content scanning, lockfile integrity, MCP trust boundaries.Secure by default. Content scanning, lockfile integrity, MCP trust boundaries.type/bugSomething does not work as documented.Something does not work as documented.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
StatusShow more project fields
Done
Summary
I cannot reliably install or update APM while connected through my company VPN, because APM does the GitHub
releases/latestlookup anonymously even when I provideGITHUB_TOKENorGITHUB_APM_PAT.That means APM can fail on GitHub's shared anonymous/IP-based quota even though
gh auth statusis healthy and my authenticated GitHub API quota is not exhausted.Observed with APM CLI
0.14.0.Symptom
With the anonymous GitHub API quota exhausted:
can fail with:
The authenticated quota can still be healthy at the same time:
gh api rate_limit --jq '.resources.core'What seems to be happening
In
install.sh, the token env vars are resolved before release lookup, but APM still makes the firstreleases/latestrequest without auth:install.shresolvesGITHUB_APM_PAT/GITHUB_TOKENintoAUTH_HEADER_VALUE.https://api.github.com/repos/$APM_REPO/releases/latestcall is made without that header."Not Found".tag_name, so the installer exits asInvalid API response received.apm self-updateappears to have the same issue one step earlier: it callsget_latest_version_from_github()before running the installer, and that helper also requestsreleases/latestwithout auth headers.Expected behavior
If
GITHUB_APM_PATorGITHUB_TOKENis set, APM should not start with an anonymous release lookup. It should either:releases/latestrequest, orWorkaround
Pin the version using authenticated
gh, which lets the installer skipreleases/latest:Related context
I searched existing issues/PRs and did not find this exact case already tracked.
Related but distinct:
VERSIONpinning, which is the current workaround.Small repro note
This form does not pass the token to the installer process:
The env assignment only applies to
curl, not theshprocess. The repro above usesexportso the installer receives the token.