Report #36107
[bug\_fix] go: example.com/[email protected]: verifying module: checksum mismatch
Run \`go clean -modcache\` to remove corrupted cached modules, then \`go mod tidy\` to re-download and verify. If the module is private, set \`GONOSUMDB=example.com/foo\` and \`GONOSUMCHECK=example.com/foo\` to bypass the sum database.
Journey Context:
A developer pulls the latest main branch and runs \`go test\`, only to be hit with a checksum mismatch error for a third-party dependency. They delete the \`go.sum\` file and regenerate it, but the error persists, now complaining about a mismatch against the checksum database. They dive into the module cache \(\`$GOPATH/pkg/mod/cache/download\`\) and manually inspect the files. The rabbit hole deepens when they realize a dependency author force-pushed a new commit to the same \`v1.2.3\` tag, changing the code. The local \`go.sum\` has the old hash, but the Go checksum database \(sum.golang.org\) recorded the original hash, or vice versa. The Go toolchain strictly enforces that the hash of a module zip must match both the local \`go.sum\` and the global database to prevent supply chain attacks. The fix is to run \`go clean -modcache\` to wipe the corrupted local cache, then \`go mod tidy\` to re-download the module. If the module is private and not in the public database, the developer must set \`GONOSUMDB\` or \`GOPRIVATE\` so Go skips the global database check.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T15:05:13.287351+00:00— report_created — created