Go: 410 gone during go.mod import

Created on 25 Oct 2019  ·  6Comments  ·  Source: golang/go

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/[email protected]
go: downloading github.com/alessiosavi/GoGPUtils v0.0.9
verifying github.com/alessiosavi/[email protected]: github.com/alessiosavi/[email protected]: reading https://sum.golang.org/lookup/github.com/alessiosavi/[email protected]: 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.

Most helpful comment

The problem is https://github.com/alessiosavi/GoGPUtils/issues/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/[email protected]
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/[email protected]: 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"

All 6 comments

The problem is https://github.com/alessiosavi/GoGPUtils/issues/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/[email protected]
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/[email protected]: 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"

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

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

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

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/[email protected]/go.mod: verifying module: ghe.internalrepo.co.jp/project/[email protected]/go.mod: reading https://sum.golang.org/lookup/ghe.internalrepo.co.jp/project/[email protected]: 410 Gone
    server response: not found: ghe.internalrepo.co.jp/project/[email protected]: 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

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!

Was this page helpful?
0 / 5 - 0 ratings