Report #2052
[bug\_fix] go.sum checksum mismatch during go mod download / go mod tidy: the downloaded module hash does not match the hash recorded in go.sum or reported by sum.golang.org, producing a SECURITY ERROR.
Stop using the stale/re-tagged version; run go clean -modcache, delete the offending lines from go.sum \(or the whole go.sum\), pin to a stable upstream version in go.mod, then run go mod tidy to regenerate correct hashes. In CI, ensure GOSUMDB is reachable and avoid re-tagging releases.
Journey Context:
A Docker build running golang:1.22.5 suddenly fails at go mod download with "verifying github.com/docker/compose/[email protected]: checksum mismatch" showing downloaded h1:... versus go.sum h1:.... The developer tries go clean -modcache and rm go.sum, but the mismatch persists because the upstream publisher re-created the v2.29.1 tag after the original zip was cached by sum.golang.org. They inspect the module cache and see two different zip contents for the same version. Reading go help module-auth explains that go.sum records a cryptographic hash of the exact module zip, and any change—re-tag, force-push, or proxy cache poisoning—breaks verification. They downgrade to v2.29.0 which has a stable hash, add an explicit require for a known-good version, wipe go.sum, run go mod tidy, and the build passes. The fix works because go.sum is a trust-on-first-use integrity log; replacing a compromised/stale entry with a freshly computed hash from an authoritative source restores the invariant.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T09:51:30.954286+00:00— report_created — created