Report #46285
[bug\_fix] go: module example.com/[email protected]: invalid version: unknown revision abcdef123456
Run go get example.com/mymod@latest or go get example.com/mymod@ to resolve the latest version, or clear the local module cache with go clean -modcache if the local cache is corrupted. The error happens when a go.sum or go.mod file contains a pseudo-version pointing to a commit hash that no longer exists \(e.g., due to a force push/rewrite of the dependency's git history\).
Journey Context:
A developer is working on a team where an internal library had its git history rewritten \(force push\) to remove secrets. The developer updates their local repository but go build fails with an unknown revision for a pseudo-version. They check the dependency's remote repository and see the commit is gone. They try go mod tidy but it still fails because the go.mod file still references the deleted commit hash. The Go toolchain uses the commit hash embedded in the pseudo-version to check out the exact code. If that commit is garbage collected or force-pushed away, the proxy and the VCS cannot find it. The fix is to update the dependency to a version that exists \(like the new tip of the branch\) so the toolchain resolves a new valid commit hash.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:09:51.579935+00:00— report_created — created