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

verifying module@v0.9.0/go.mod: ... reading module@v0.9.0: 410 Gone #36183

Closed
mholt opened this issue Dec 17, 2019 · 11 comments
Closed

verifying module@v0.9.0/go.mod: ... reading module@v0.9.0: 410 Gone #36183

mholt opened this issue Dec 17, 2019 · 11 comments

Comments

@mholt
Copy link

mholt commented Dec 17, 2019

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

$ go version
go version go1.13.5 darwin/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=""
GOCACHE="/Users/matt/Library/Caches/go-build"
GOENV="/Users/matt/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/matt/Dev"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/matt/Dev/src/github.com/caddyserver/caddy/go.mod"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/sf/7w4p15_15jb59d7kwy0wglh40000gn/T/go-build947643690=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Run:

$ go get github.com/mholt/certmagic@v0.9.0

What did you expect to see?

No error

What did you see instead?

verifying github.com/mholt/certmagic@v0.9.0/go.mod: github.com/mholt/certmagic@v0.9.0/go.mod: reading https://sum.golang.org/lookup/github.com/mholt/certmagic@v0.9.0: 410 Gone

This is weird, because the tag is new and unmodified (no deletions, no renames, no force pushes, etc) -- I am the only one who has committed to this repo at all recently (like, in the last several weeks/months) and I need to use the v0.9.0 tag for a new build: https://github.com/mholt/certmagic/tree/v0.9.0

Edit:

Also tried GOPROXY=direct and the same error.

(The tag is "new" but several minutes old.)

@heschi
Copy link
Contributor

heschi commented Dec 17, 2019

If this is a new tag, almost certainly duplicate of #34370 (comment).

@heschi heschi closed this as completed Dec 17, 2019
@heschi
Copy link
Contributor

heschi commented Dec 17, 2019

For posterity, the error from the sumdb:
not found: github.com/mholt/certmagic@v0.9.0: invalid version: unknown revision v0.9.0

@mholt
Copy link
Author

mholt commented Dec 17, 2019

The tag was posted several minutes before the command though?

@mholt
Copy link
Author

mholt commented Dec 17, 2019

I don't think this is a duplicate, because in that issue the tag was created after the command was run, but for me, the tag was created before running the command.

Edit: Well, it's working now. But it sure would be nice if the repo owner could tell the cache to invalidate a wrong state.

@aofei
Copy link
Contributor

aofei commented Dec 17, 2019

I don't think this is a duplicate, because in that issue the tag was created after the command was run, but for me, the tag was created before running the command.

Your first command was run at Tue, 17 Dec 2019 17:32:19 GMT (no matched tag was found at this time). But v0.9.0 was cached by proxy.golang.org at Tue, 17 Dec 2019 17:33:16 GMT.

@mholt
Copy link
Author

mholt commented Dec 17, 2019

That is weird, though. Doesn't match up with what I did, I wonder if there was some lag in a system between my computer and the proxy and the git server.

@aofei
Copy link
Contributor

aofei commented Dec 17, 2019

And the cache has just expired:

aofei@as-macbook-pro:~$ curl -i https://sum.golang.org/lookup/github.com/mholt/certmagic@v0.9.0                                                                                                                                              
HTTP/2 200 
accept-ranges: bytes
content-length: 365
content-type: text/plain; charset=UTF-8
date: Tue, 17 Dec 2019 17:54:02 GMT
expires: Tue, 17 Dec 2019 20:54:02 GMT
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 0
cache-control: public, max-age=10800
age: 118

546235
github.com/mholt/certmagic v0.9.0 h1:dYh9sZPDBTcIiPhYM/Qtv3V623/zFH34FmpbrQTpMAc=
github.com/mholt/certmagic v0.9.0/go.mod h1:91uJzK5K8IWtYQqTi5R2tsxV1pCde+wdGfaRaOZi6aQ=

go.sum database tree
546279
uVHuaN+c8KtdVSSph74Y+Zmdma8fYIqx7HMDhFjoaok=

— sum.golang.org Az3groND3X+FPNnslWNpFahhwLVCH4Ww5b0OEi5KpyPEWplyvt4qc00TB/pcpRgDKzJQQql7DnNiTWcKAHnPijt3ego=

@heschi
Copy link
Contributor

heschi commented Dec 17, 2019

I checked the internal logs for proxy/sum.golang.org. The first request they ever got for certmagic v0.9.0 was at 2019-12-17 17:23:35 UTC, which is the request that resulted in the negative cache entry in question. The GitHub UI for https://github.com/mholt/certmagic/releases/tag/v0.9.0 says that it was tagged at 12:22 EST, or 17:22 UTC. I don't have any explanation for the mismatch; the go command just says that it couldn't find that version. Was the tag created using the GitHub UI, in which case maybe there's some delay there?

@mholt
Copy link
Author

mholt commented Dec 17, 2019

No, it was command line. Maybe it took GitHub a minute to sync or something. Thanks for looking into it.

@mholt
Copy link
Author

mholt commented Dec 17, 2019

Incidentally, 410 Gone means:

The target resource is no longer available at the origin server and that this condition is likely to be permanent.

If the origin server does not know, or has no facility to determine, whether or not the condition is permanent, the status code 404 Not Found ought to be used instead.

This is clearly not the case with the module cache.

Additionally, perhaps negative hits should not be cached.

@heschi
Copy link
Contributor

heschi commented Dec 17, 2019

410 is necessary for internal implementation reasons.

The need for negative caching is described in #34370 (comment).

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

4 participants