Report #104422
[bug\_fix] go.sum: verification of checksum failed: example.com/[email protected]: mismatch \(expected hash, got hash\)
Delete the corrupted or stale go.sum file and regenerate it with \`go mod tidy\`. Alternatively, if the module was replaced or retracted, update the dependency version in go.mod and then run \`go mod download\` to fetch the correct checksums.
Journey Context:
A developer was working on a CI/CD pipeline and noticed that builds intermittently failed with a go.sum verification error. The error pointed to a specific third-party package. The developer initially suspected a network issue or a malicious package, so they cleared the Go module cache with \`go clean -modcache\` and re-ran \`go mod download\`, but the error persisted. After digging into the go.sum file, they found that the hash for the package was different from what remote proxy returned. The root cause was that the developer had previously replaced that module with a local fork using a \`replace\` directive in go.mod, and the local fork had different content. The go.sum had been partially updated but not fully synced. The fix was to remove the \`replace\` directive, delete go.sum, and run \`go mod tidy\` to rebuild the checksum database from the canonical source. This is a common pitfall when mixing local replacements and remote dependencies.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-08-16T20:05:47.424073+00:00— report_created — created