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

cmd/go: go get -u behaves differently with and without GOPROXY when a module doesn't exist at head #31766

hyangah opened this issue Apr 30, 2019 · 2 comments
GoCommand modules NeedsInvestigation


Copy link

@hyangah hyangah commented Apr 30, 2019

$ go version
go version devel +fbc6a97222 Mon Apr 29 19:54:30 2019 +0000 linux/amd64

The problem exists with go1.12 as well.

What did you do?

Without proxy, I could run go get -u successfully. With proxy, it fails with cryptic error message.

$ export GOPROXY=direct
$ mkdir scratch; cd scratch; go mod init example
$ go get
$ go get -u
go: finding latest
go: finding latest
go: finding latest
go: finding latest
go: finding latest
go: finding latest
go: finding latest
go: finding latest
$ export GOPROXY=
$ mkdir scratch; cd scratch; go mod init example
$ go get
$ go get -u
go get: upgrading reading 404 Not Found

What happens underneath:

The viper module or its dependencies have dependency on The does not exist in the origin at head (no go.mod file, no valid tag), but it probably existed with @d75b2dc. Thus, go mod download succeeds with and without GOPROXY.

But when trying to upgrade, with GOPROXY=direct, the go command runs a sequence of git commands and detects there is no tag, no go.mod file at head and doesn't attempt to upgrade.

With GOPROXY=, the go command queries /@v/list endpoint to find available module versions. The proxy doesn't know about the named module (because the module doesn't exist according to what go list -m -v reports), so answers HTTP error (404/410/500/...). Then, the go command treats it as a hard error.

I think in this case (the list query failure), the go command should not fail but proceed as if there is no newer version to upgrade (indeed, there is no version to upgrade to!)

Copy link

@fatduo fatduo commented May 10, 2019


go get: upgrading unexpected status (http://*********/ 500 Internal Server Error

athen log

ERRO[0308] exit status 1: go: finding latest
go list -m no matching versions for query "latest"  http-method=GET http-path=/ http-url=/ kind="Internal Server Error" module= operation=download.ListHandler ops="[download.ListHandler pool.List protocol.List vcsLister.List]" version=

Copy link

@bcmills bcmills commented May 22, 2019

CC @jayconrod

@bcmills bcmills added this to the Go1.13 milestone May 22, 2019
@bcmills bcmills added the NeedsInvestigation label May 22, 2019
@andybons andybons removed this from the Go1.13 milestone Jul 8, 2019
@andybons andybons added this to the Go1.14 milestone Jul 8, 2019
@rsc rsc removed this from the Go1.14 milestone Oct 9, 2019
@rsc rsc added this to the Backlog milestone Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
GoCommand modules NeedsInvestigation
None yet

No branches or pull requests

5 participants