Report #49436
[bug\_fix] go: updates to go.sum needed, disabled by -mod=readonly
Run \`go mod tidy\` locally to update the \`go.sum\` file with the new dependency checksums, then commit the updated \`go.sum\` to version control.
Journey Context:
A developer adds a new third-party package to their code and runs \`go build\` locally, which succeeds. They push the code, but the CI pipeline fails with 'updates to go.sum needed, disabled by -mod=readonly'. The developer is confused because it works perfectly on their laptop. They try to reproduce the CI environment but fail. The root cause is that the developer only committed the \`go.mod\` changes \(or neither\), and the local build automatically added the missing checksums to \`go.sum\`. However, modern Go CI pipelines default to \`-mod=readonly\` to prevent hidden dependency mutations during automated builds. Because the \`go.sum\` in the repository lacks the required hashes, the readonly build fails. The developer runs \`go mod tidy\` locally, verifies that \`go.sum\` is updated, commits both \`go.mod\` and \`go.sum\`, and the CI build passes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:27:30.192254+00:00— report_created — created