go: proxy.golang.org: returns not found for @v/list of a module deleted from the origin

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

$ go version

Does this issue reproduce with the latest release?

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

go env Output
$ go env

What did you do?

$ curl https://proxy.golang.org/github.com/belogik/goes/@v/list
not found: github.com/belogik/goes@latest: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/0c31a160b38443d5e33ca2a5e60e51734d83293b66dc3d9b0c12699f8d2b5cec: exit status 128:
	fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.

What did you expect to see?

List of available versions.

What did you see instead?

Error.

The reason seems due to github.com/belogik/goes was recently removed by the author. If I query for specific version, proxy still returns the result.

$ curl https://proxy.golang.org/github.com/belogik/goes/@v/v0.0.0-20151229125003-e54d722c3aff.info
{"Version":"v0.0.0-20151229125003-e54d722c3aff","Time":"2015-12-29T12:50:03Z"}

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (15 by maintainers)

Most upvoted comments

After internal discussion, we think this behavior of proxy.golang.org is, if not an outright bug, undesirable. The module author is free to set GOPRIVATE and do whatever they need to do, but downstream users can’t add a dependency on the module without knowing a valid pseudoversion somehow.

$ go get -x github.com/belogik/goes@latest
# get https://proxy.golang.org/github.com/@v/list
# get https://proxy.golang.org/github.com/belogik/@v/list
# get https://proxy.golang.org/github.com/belogik/goes/@v/list
# get https://proxy.golang.org/github.com/belogik/goes/@v/list: 410 Gone (0.165s)
# get https://proxy.golang.org/github.com/@v/list: 410 Gone (0.269s)
# get https://proxy.golang.org/github.com/belogik/@v/list: 410 Gone (0.270s)
# get https://github.com/?go-get=1
mkdir -p /.../pkg/mod/cache/vcs # git3 https://github.com/belogik/goes
# lock /.../pkg/mod/cache/vcs/0c31a160b38443d5e33ca2a5e60e51734d83293b66dc3d9b0c12699f8d2b5cec.lock# /.../pkg/mod/cache/vcs/0c31a160b38443d5e33ca2a5e60e51734d83293b66dc3d9b0c12699f8d2b5cec for git3 https://github.com/belogik/goes
cd /.../pkg/mod/cache/vcs/0c31a160b38443d5e33ca2a5e60e51734d83293b66dc3d9b0c12699f8d2b5cec; git ls-remote -q origin
# get https://github.com/?go-get=1: 200 OK (0.035s)
0.075s # cd /.../pkg/mod/cache/vcs/0c31a160b38443d5e33ca2a5e60e51734d83293b66dc3d9b0c12699f8d2b5cec; git ls-remote -q origin
# get https://github.com/belogik/goes
# get https://github.com/belogik/goes: 404 Not Found (0.097s)
go get github.com/belogik/goes@latest: module github.com/belogik/goes: git ls-remote -q origin in /.../pkg/mod/cache/vcs/0c31a160b38443d5e33ca2a5e60e51734d83293b66dc3d9b0c12699f8d2b5cec: exit status 128:
	fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.

This isn’t the user experience we want proxy.golang.org to give. I’ll work on changing it to successfully return an empty list so that the go command will fall back to @latest.

Proxy.golang.org returns known non pseudo versions if there are cached ones available for use. In this specific case, I think there are no non-pseudo versions.

Hmm, should /@v/list return a 200 with an empty list then? It looks like /@latest for this module returns 200 with a pseudo-version.

The go command will request /@v/list first, and if that fails with any error (including 404, 410), we’ll fall back to the next proxy. We only request /@latest if the request for /@v/list is successful but contains no suitable versions.

Proxy.golang.org returns known non pseudo versions if there are cached ones available for use. In this specific case, I think there are no non-pseudo versions.