Skip to content
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

go mod download can't find module tag v0.0.1 #41484

Closed
dwschulze opened this issue Sep 18, 2020 · 5 comments
Closed

go mod download can't find module tag v0.0.1 #41484

dwschulze opened this issue Sep 18, 2020 · 5 comments

Comments

@dwschulze
Copy link

@dwschulze dwschulze commented Sep 18, 2020

$ go version
go1.15.1 linux/amd64

I have a module in github.

I added this to my ~/.gitconfig: [url "ssh://git@github.com/"] insteadOf = https://github.com/

When I try to use the module from my main go mod download cannot find v0.0.1 of the module even though the tag v0.0.1 exists in github:

$ go run main.go
go: github.com/dwschulze/go-module-test-dateutilmod@v0.0.1/go.mod: verifying module: github.com/dwschulze/go-module-test-dateutilmod@v0.0.1/go.mod: reading https://sum.golang.org/lookup/github.com/dwschulze/go-module-test-dateutilmod@v0.0.1: 410 Gone
        server response: not found: github.com/dwschulze/go-module-test-dateutilmod@v0.0.1: invalid version: unknown revision v0.0.1

$ go mod download  github.com/dwschulze/go-module-test-dateutilmod@v0.0.1
github.com/dwschulze/go-module-test-dateutilmod@v0.0.1/go.mod: verifying module: github.com/dwschulze/go-module-test-dateutilmod@v0.0.1/go.mod: reading https://sum.golang.org/lookup/github.com/dwschulze/go-module-test-dateutilmod@v0.0.1: 410 Gone
	server response: not found: github.com/dwschulze/go-module-test-dateutilmod@v0.0.1: invalid version: unknown revision v0.0.1

The tag v0.0.1 exists:

$ git clone git@github.com:dwschulze/go-module-test-dateutilmod.git
Cloning into 'go-module-test-dateutilmod'...
...
$ cd go-module-test-dateutilmod/
$ git tag
v0.0.1
@bcmills
Copy link
Member

@bcmills bcmills commented Sep 18, 2020

That said, we should give a better error message for this.

@bcmills
Copy link
Member

@bcmills bcmills commented Sep 18, 2020

Duplicate of #25982

@bcmills bcmills marked this as a duplicate of #25982 Sep 18, 2020
@bcmills bcmills closed this Sep 18, 2020
@dwschulze
Copy link
Author

@dwschulze dwschulze commented Sep 19, 2020

I was able to get this to work with export GOPRIVATE=githib.com. So I thought I understood what the problem was and what the solution was. But then if I delete GOPATH/pkg and do unset GOPRIVATE I found that it still works. It downloads the module into GOPATH/pkg:

$ echo $GOPRIVATE

$ go run main.go
go: downloading github.com/dwschulze/go-module-test-dateutilmod v0.0.1
github:  2020-09-18 18:21:58.244789426 -0600 MDT  //  output from main()

But it shouldn't work with GOPRIVATE unset. What is going on that it works? Is there a hidden cache somewhere?

@dwschulze
Copy link
Author

@dwschulze dwschulze commented Sep 19, 2020

I do not believe that this is a duplicate of #25982. That is an earlier version of go and the issue seems to be credentials for vcs repos, not what go mod download does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.