Repository navigation
Description
The problem
Go module downloads in CI fail intermittently with an HTTP/2 error from Google's module servers. When that happens, a correct PR goes red on a required check until someone re-runs the job:
read "https://proxy.golang.org/github.com/aws/smithy-go/@v/v1.28.5.zip": stream error: stream ID 15; INTERNAL_ERROR; received from peer
reading https://sum.golang.org/tile/8/1/006: stream error: stream ID 1645; INTERNAL_ERROR; received from peer
Go retries neither. A failed module fetch is a build failure, so the job dies before compiling anything, and the log reads like a code problem.
Incidents
| When | PR | Failed job | What failed to download |
|---|---|---|---|
| 2026-10-06 | #582 | fuzz-smoke (./internal/vfs, FuzzAttrFromMetadata), hung 10 min then timed out |
klauspost/compress v1.20.1, lz4 v4.1.31 (bumped on main by #577) |
| 2026-10-18 | #631 | cross-build (linux, amd64) |
aws-sdk-go-v2 v1.47.3 (bumped on main by #620) |
| 2026-10-19 | #622 | fuzz-smoke (… FuzzWholeObjectResponse) |
smithy-go v1.28.5 (bumped on main by #620) |
| 2026-10-19 | #632, #622, #614 | Security Scan |
go install github.com/google/go-licenses@latest: a sum.golang.org tile |
Every one was a network error, not a finding. Re-running only the failed job passed each time.
Hypothesis (not yet proven)
Each module that failed had just been bumped on main. A PR run builds the merge with main, so its go.sum is main's new one, and setup-go's module cache, keyed on go.sum, has nothing saved for that key until main's own run saves it. So right after a dependency bump lands, every open PR downloads every module fresh, and that's when the flaky server gets its chances. The Security Scan failures are a second path: go install …@latest tools aren't covered by that cache at all.
Proposed fix
- A retrying
go mod downloadstep before build/test in each Go job: three attempts with backoff, retrying only on the transient signatures (INTERNAL_ERROR, 5xx, timeouts, connection resets). The build then starts from a populated module cache and never downloads itself. This works whether or not the hypothesis holds. - Pin the security tools (
govulncheck,go-licenses) to versions instead of@latest, and install them through the same retry. Pinning is right on its own:@latestmakes the security gate's own behaviour change without a commit. - Don't retry real failures. A module that genuinely doesn't exist (404 / not found) must still fail fast. This is the same three-way split ci: the deploy image check retries transient registry errors instead of failing on them #632 uses for registry images.
Acceptance
- Transient module-server errors are retried, with each retry visible in the log; a missing module still fails on the first attempt
-
govulncheckandgo-licensesare pinned and installed through the retry - Verified by simulating the failure (for example a
GOPROXYpointing at a stub that returns a stream error, then a success) rather than waiting for the real one
Activity
ci: retry transient Go module-server errors, and pin the security too…