-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: "unknown revision" error due to git client corruption in the Go module cache #43260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
@dzrtc, thanks. That's a new enough version that we ought to be able to support it. It appears that the So regardless of whether this is a |
Yes, I should've saved the modcache repo; I'll watch for it to reoccur and try to save more state. I have no particular dependency on 2.24, and could upgrade. |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
What version of Go are you using (
go version
)?go version go1.14.2 darwin/amd64
Does this issue reproduce with the latest release?
I don't know how to repro this issue; it appears intermittently.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I created a new private repo on GitHub, populated it, and about ~10 minutes later attempted to
go get
it into another project on my local machine. This failed, and after several additional commands (below), I realized that the mod cache entry itself was corrupted.Manually deleting the entry from the mod cache, then issuing the original command (command 1 below) again appears to have resolved the issue.
What did you expect to see?
That the module downloaded.
What did you see instead?
Below:
Command 1
Command 2
Same as command 1, yet without
@master
.Command 3
Same as command 2, yet without
GOPRIVATE
,GIT_TERMINAL_PROMPT
.Mitigation
After trying a number of things, I decided to just manually purge the entry from the cache.
After that, reissuing command 1 (above), resulted in the module being downloaded successfully as originally expected. Note that both
GOPRIVATE
and@master
are present in this successful attempt.Discussion
The documentation strongly communicates that the mod cache is immutable and shouldn't be touched. The tooling reinforces that by treating the mod cache as an all-or-nothing construct --
go clean --modcache
drops the entire thing.However, with this issue and mitigation, I've learned that individual entries get corrupted in a way that can be corrected by surgically deleting a specific cache entry.
It would be extremely helpful if the the
go clean
command were to be updated to allow an individual module to be purged from the mod cache (and for the variousgo get
error paths and/or documentation to suggest that purging a single module from the cache can resolve issues).The text was updated successfully, but these errors were encountered: