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

410 gone during go.mod import #35164

Closed
alessiosavi opened this issue Oct 25, 2019 · 10 comments
Closed

410 gone during go.mod import #35164

alessiosavi opened this issue Oct 25, 2019 · 10 comments

Comments

@alessiosavi
Copy link

alessiosavi commented Oct 25, 2019

What version of Go are you using (go version)?

$ go version
go version go1.13.3 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN="/opt/DEVOPS/SDK/golang/go_projects/bin"
GOCACHE="/home/alessiosavi/.cache/go-build"
GOENV="/home/alessiosavi/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/opt/DEVOPS/SDK/golang/go_projects"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/DEVOPS/SDK/golang/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/DEVOPS/SDK/golang/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build891034950=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I'm trying to import a custom golang module that does not contain any other dependencies (go.mod contains only the module name and the go version). Unfortunately, i receive a 410 gone if i try to include the module in other project.
The module can be imported with the version v0.0.8, but not with >v0.0.9

Due to the go.mod file, is not possible to replicate on play.golang.org, instead, i've created a new repository for that: https://github.com/alessiosavi/test
NOTE: changing the module version to v0.0.8, it will work

What did you expect to see?

I expect that importing the module in go.mod (require github.com/alessiosavi/GoGPUtils v0.0.10
) and running a go clean, the module can be used among the code

What did you see instead?

I receive an error:

export GO111MODULE=on
export GOPROXY=direct
go get -v -u github.com/alessiosavi/GoGPUtils@v0.0.9
go: downloading github.com/alessiosavi/GoGPUtils v0.0.9
verifying github.com/alessiosavi/GoGPUtils@v0.0.9: github.com/alessiosavi/GoGPUtils@v0.0.9: reading https://sum.golang.org/lookup/github.com/alessiosavi/!go!g!p!utils@v0.0.9: 410 Gone

Possible related

#34528
#34795
#34402
#34370

###Possible solution
Have an eye on: https://proxy.golang.org/YOUR_MODULE_GITH_URL/@v/VERSION.info

Seems that https://proxy.golang.org/github.com/alessiosavi/!go!g!p!utils/@v/v0.0.9.info
In my case, seems that the error is related to two files that differ only for the case in the name.

@dmitshur
Copy link
Contributor

dmitshur commented Oct 25, 2019

The problem is alessiosavi/GoGPUtils#2.

To get a more complete and helpful error message, you should visit the URL that returned 410 in the error message you got:

https://sum.golang.org/lookup/github.com/alessiosavi/!go!g!p!utils@v0.0.9

It says:

not found: unzip /tmp/gopath/pkg/mod/cache/download/github.com/alessiosavi/!go!g!p!utils/@v/v0.0.9.zip: case-insensitive file name collision: "tests/fileutils/FindMe.txt" and "tests/fileutils/findme.txt"

Or set GOSUMDB=off in addition to setting GOPROXY=direct:

$ export GO111MODULE=on
$ export GOPROXY=direct
$ export GOSUMDB=off
$ go get -v -u github.com/alessiosavi/GoGPUtils@v0.0.9
go: finding github.com/alessiosavi/GoGPUtils v0.0.9
go: downloading github.com/alessiosavi/GoGPUtils v0.0.9
go: extracting github.com/alessiosavi/GoGPUtils v0.0.9
-> unzip /var/folders/zb/5p8cwfhj29gf_m8vdy8ylmlr00jwcj/T/tmp.6HERCDpw/pkg/mod/cache/download/github.com/alessiosavi/!go!g!p!utils/@v/v0.0.9.zip: case-insensitive file name collision: "tests/fileutils/FindMe.txt" and "tests/fileutils/findme.txt"
go get github.com/alessiosavi/GoGPUtils@v0.0.9: unzip /var/folders/zb/5p8cwfhj29gf_m8vdy8ylmlr00jwcj/T/tmp.6HERCDpw/pkg/mod/cache/download/github.com/alessiosavi/!go!g!p!utils/@v/v0.0.9.zip: case-insensitive file name collision: "tests/fileutils/FindMe.txt" and "tests/fileutils/findme.txt"

@alessiosavi
Copy link
Author

As always, another day, another problem solved by @dmitshur. Thank you for the effort (:

@xlab
Copy link

xlab commented Dec 6, 2019

Another Go version, another ENV variable to care about & set in Dockerfiles 🤣

@wildneuro
Copy link

Essentially as @dmitshur pointed out correctly:
export GOSUMDB=off
Helped.

@golddranks
Copy link

This thread saved me. Thank you.

Go tools could really use a bit brushed up error messages. I was really lost with a message like below. I know hardly nothing about the new module-related developments (except that I laud the intent!), and having impenetrable error messages makes it really hard to migrate.

go: ghe.internalrepo.co.jp/project/our_project@v0.0.0-20200223452263-567823423434/go.mod: verifying module: ghe.internalrepo.co.jp/project/our_project@v0.0.0-20200223452263-567823423434/go.mod: reading https://sum.golang.org/lookup/ghe.internalrepo.co.jp/project/our_project@v0.0.0-20200223452263-567823423434: 410 Gone
	server response: not found: ghe.internalrepo.co.jp/project/our_project@v0.0.0-20200223452263-567823423434: unrecognized import path "ghe.internalrepo.co.jp/project/our_project": https fetch: Get "https://ghe.internalrepo.co.jp/project/our_project?go-get=1": dial tcp 123.123.123.123:443: connect: connection refused

@golddranks
Copy link

golddranks commented May 22, 2020

Ah, to provide some more hints for people that find this thread: export GOSUMDB=off helped to fix the issue, but I at least in my case the "proper" (in the sense that it doesn't touch how public dependencies are accessed) fix is was to set export GOPRIVATE=ghe.internalrepo.co.jp. It still baffles me, though, how it wouldn't try to directly access the repository after failing with GOSUMDB, but just fail right away with a cryptic message. For Go developers: the message looks way more cryptic if you don't know about the concepts, so please please do some UX work around it!

@radu-munteanu
Copy link

Thanks Google for adding default beacons into Golang tools! Opt in by default. Well done!

@ianlancetaylor
Copy link
Contributor

@radu-munteanu That is not what is happening here. You may be interested in https://go.googlesource.com/proposal/+/refs/heads/master/design/25530-sumdb.md

@radu-munteanu
Copy link

radu-munteanu commented Jan 8, 2021

@ianlancetaylor It happened to me with internal company modules, so it is happening. I've got an error that the modules were not found, it said reading https://sum.golang.org/lookup/company name modules server path (first beacon), and then it did a lookup of the internal server name on 8.8.8.8:53 which is not our internal DNS server, so it sent directly a request to Google DNS server (second beacon). THIS IS THE DEFAULT BEHAVIOUR. Throwing a paper in front doesn't make you right.

@ianlancetaylor
Copy link
Contributor

@radu-munteanu Reading sum.golang.org by default is intentional. You can control that by setting the GOSUMDB environment variable, as documented at https://golang.org/cmd/go. See also https://sum.golang.org/privacy.

Contacting 8.8.8.8 doesn't sound right. Please file an issue with complete reproduction instructions. Thanks.

@golang golang locked and limited conversation to collaborators Jan 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants