Skip to content

fix(proxies): rewrite GOPROXY's fallback list, not just single URLs - #209

Merged
luthermonson merged 2 commits into
mainfrom
fix/advertise-goproxy-list
Oct 5, 2026
Merged

luthermonson merged 2 commits into
mainfrom
fix/advertise-goproxy-list

Conversation

@luthermonson

Copy link
Copy Markdown
Contributor

#208 rewrote the advertised host for every URL-valued proxy var — except the one that matters most in a Go codebase.

GOPROXY is not a URL, it is a fallback list: Go accepts elements separated by , or |, mixed with the literals direct and off. Production emits http://10.88.0.1:8082|direct, and url.Parse on that whole string yields no usable authority — so the single-URL rewrite passed it straight through.

Caught by reading the live node, minutes after rolling v0.2.17

GOPROXY=http://10.88.0.1:8082|direct                <- NOT rewritten
RUSTUP_DIST_SERVER=http://192.168.64.1:8083/rustup  <- ok
GHREL_PROXY=http://192.168.64.1:8087                <- ok
COMPOSER_REPO_PACKAGIST=http://192.168.64.1:8088    <- ok

Three of four correct, and the daemon logged cache proxies advertised to jobs on the VM-visible host address host=192.168.64.1. Success by every available signal except the bytes — Go kept pointing at an address that does not exist.

Why the tests missed it

The fixture was GOPROXY=http://host:port — an input I invented rather than observed. It is now copied verbatim off mfl-mac-arm64, with a comment telling the next person not to tidy it. Same failure as the ghrel fake upstream that ignored Accept: a test that models what you assume, not what the system emits.

Also fixed: the probe was blind too

EnvHostPorts parsed the whole value, so it never saw the Go proxy's address — meaning the reachability gate would advertise a host it had never checked. That defeats the entire point of the gate.

Behaviour

Separators and literals round-trip exactly: a|direct, a,direct, multiple proxies, off, direct alone, and a trailing separator.

Revert-verified — restoring the single-URL call fails both the fleet-env test and the new list table. Cross-builds and vets clean for linux, darwin, windows.

#208 rewrote the advertised host for every URL-valued proxy var — except
the one that matters most on a Go codebase. GOPROXY is not a URL, it is a
fallback LIST: Go accepts elements separated by "," or "|" mixed with the
literals "direct" and "off". Production emits

  GOPROXY=http://10.88.0.1:8082|direct

and url.Parse on that whole string yields no usable authority, so the
single-URL rewrite passed it through untouched.

Read off mfl-mac-arm64 minutes after rolling v0.2.17:

  GOPROXY=http://10.88.0.1:8082|direct                <- NOT rewritten
  RUSTUP_DIST_SERVER=http://192.168.64.1:8083/rustup  <- ok
  GHREL_PROXY=http://192.168.64.1:8087                <- ok
  COMPOSER_REPO_PACKAGIST=http://192.168.64.1:8088    <- ok

Three of four correct, and the log line said "cache proxies advertised to
jobs on the VM-visible host address" — success by every signal except the
one that counts. Go kept pointing at an unreachable address.

Why the tests missed it: the fixture used a bare
GOPROXY=http://host:port, an input invented rather than observed. It is
now copied verbatim from the live node, with a comment not to tidy it.

Also fixes the probe: EnvHostPorts parsed the whole value, so it never
saw the Go proxy's address and would have advertised a host it never
checked — defeating the gate's purpose.

Separators and literals are preserved exactly: "a|direct", "a,direct",
multiple proxies, "off", and a trailing separator all round-trip.

Revert-verified: restoring the single-URL call fails both the fleet-env
test and the new list table.
@ephpm

ephpm Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

ePHPm Preview — removed

Preview deployment has been torn down.

@ephpm
ephpm Bot temporarily deployed to preview-pr-209 October 2, 2026 05:55 Inactive
@ephpm
ephpm Bot temporarily deployed to preview-pr-209 October 2, 2026 05:55 Inactive
@ephpm
ephpm Bot temporarily deployed to preview-pr-209 October 2, 2026 05:55 Inactive
@ephpm
ephpm Bot temporarily deployed to preview-pr-209 October 5, 2026 21:17 Inactive
@ephpm
ephpm Bot temporarily deployed to preview-pr-209 October 5, 2026 21:17 Inactive
@luthermonson
luthermonson merged commit 1383eb9 into main Oct 5, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
preview-pr-209 — a74ae4b0 Deployed Oct 5, 2026 by ephpm[bot]
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