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
cmd/go: origin does not appear to be a git repo
error on all go mod commands
#38709
Comments
Thanks for the report. Since this appears to be filesystem corruption and we don't know the cause, I'm going to go ahead and close this issue, but we'll watch for a pattern — if we get more reports of similar issues we'll certainly want to take a closer look. |
origin does not appear to be a git repo
error on all go mod commandsorigin does not appear to be a git repo
error on all go mod commands
I'd like to note that this just happened to me as well. $ go get -u github.com/matthewmueller/diff
go get github.com/matthewmueller/diff: module github.com/matthewmueller/diff: git ls-remote -q origin in /Users/m/Go/pkg/mod/cache/vcs/5f9f95779422363e8e24e203ef2f34dbab3a4cb052f98aa116323dc518593f13: exit status 128:
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
$ git remote -v
origin git@github.com:matthewmueller/duojs.git (fetch)
origin git@github.com:matthewmueller/duojs.git (push)
$ rm -rf /Users/m/Go/pkg/mod/cache/vcs/5f9f95779422363e8e24e203ef2f34dbab3a4cb052f98aa116323dc518593f13
$ go get -u github.com/matthewmueller/diff
go: github.com/matthewmueller/diff upgrade => v0.0.0-20191220174011-88a65b538395
go: github.com/sergi/go-diff upgrade => v1.1.0
go: github.com/kr/pretty upgrade => v0.2.0
go: github.com/kr/text upgrade => v0.2.0
go: downloading github.com/kr/text v0.2.0 I recently made this repository public and added go.mod (not sure if before or after). |
@matthewmueller Which repository did you make public? Are you able to reproduce this? If so, can you post the Could you post any relevant parts of |
Yep!
Sorry, I deleted this cache. I'll be sure to save it if I run into this again.
This has been here for awhile though. One thing I did recently is add
|
@matthewmueller Your If you (or anyone else) run into this problem in the future, it would be helpful if you could post:
|
@balopat @matthewmueller you are a life-saver! I have been looking for the solution for almost a day, and this is exactly what fix mine. Thank you for sharing! |
I wish I had read to the bottom of this issue about saving the cache folder for troubleshooting. I turfed my cache after running into this error:
|
We faced this issue recently and for us it was introduced due to the recent git vulnerability update i.e, the pkg mod cache was owned by some other user and go process was being run by another user. Since git prevents you from running git commands inside dirs not owned by you after the recent update (fatal: unsafe repository (‘/dir/path’ is owned by someone else), go was unable to run We also initially thought that the cache got corrupted somehow but that wasn't the case for us. So, for others who face this issue in the future, please try this first before deleting the cache to find the RC:
Question for maintainers - I'm just curious why the actual git error msg wasn't shown by go and
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
no.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
go list -m -json
or anygo mod
commandsWhat did you expect to see?
What did you see instead?
Deleting the cache folder ended up helping:
rm -rf /Users/balintp/go/pkg/mod/cache/vcs/3930fbb77689992ff1e965e902478ed592c6673062a4ad1276ed7dda23a6a131
Which means that somehow the cache gets into an invalid state (not sure how that happened). And I wish I'd
move
d the folder instead of deletion - now I can't give you more detail around what the state of that folder was.The text was updated successfully, but these errors were encountered: