sum.golang.org:对于现有的非常大的仓库,返回404未找到,

ovfsdjhp  于 5个月前  发布在  Go
关注(0)|答案(8)|浏览(48)

你正在使用的Go版本是什么( go version )?

$ go version
go version go1.19.2 linux/amd64

这个问题在最新版本中是否重现?

是的

你正在使用什么操作系统和处理器架构( go env )?

go env 输出

$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/tom/.cache/go-build"
GOENV="/home/tom/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/tom/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/tom/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
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 -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1236717261=/tmp/go-build -gno-record-gcc-switches"

你做了什么?

更新了一个模块中的 ignite/cli 依赖项到一个新版本 dffafa16f6fd91d9ef4462570038210c518d08dd

$ go get github.com/ignite/cli@dffafa16f6fd91d9ef4462570038210c518d08dd
go: downloading github.com/ignite/cli v0.24.1-0.20221012132336-dffafa16f6fd
go: github.com/ignite/cli@dffafa16f6fd91d9ef4462570038210c518d08dd: github.com/ignite/cli@v0.24.1-0.20221012132336-dffafa16f6fd: verifying module: github.com/ignite/cli@v0.24.1-0.20221012132336-dffafa16f6fd: reading https://sum.golang.org/lookup/github.com/ignite/cli@v0.24.1-0.20221012132336-dffafa16f6fd: 404 Not Found
	server response: not found:

在不使用特定模块的情况下,问题仍然可重现:

  1. 获取伪版本号
$ go list -m -json github.com/ignite/cli@dffafa16f6fd91d9ef4462570038210c518d08dd
{
	"Path": "github.com/ignite/cli",
	"Version": "v0.24.1-0.20221012132336-dffafa16f6fd",
	"Query": "dffafa16f6fd91d9ef4462570038210c518d08dd",
	"Time": "2022-10-12T13:23:36Z",
	"Origin": {
		"VCS": "git",
		"URL": "https://github.com/ignite/cli",
		"TagSum": "t1:yeejinhZSpi1V0OWB9y12hJfyz/MNKldv/v/ajQ87xE=",
		"Hash": "dffafa16f6fd91d9ef4462570038210c518d08dd"
	}
}
  1. 使用伪版本号请求sumdb
$ curl https://sum.golang.org/lookup/github.com/ignite/cli@v0.24.1-0.20221012132336-dffafa16f6fd
not found:

你期望看到什么?

sum.golang.org 应该返回校验和数据,而不是404。

你看到了什么?

sum.golang.org 返回了一个404未找到错误。

bihw5rsg

bihw5rsg1#

你能在干净的vanilla环境中运行以下命令吗?(没有特殊的github权限等)
GOPROXY=direct GOPRIVATE=github.com/ignite/cli GOMODCACHE=/tmp/foo go mod download -x github.com/ignite/cli@v0.24.1-0.20221012132336-dffafa16f6fd
这个命令在我电脑上运行时间很长(在git fetch -f origin 'refs/heads/*:refs/heads/*' 'refs/tags/*:refs/tags/*' for a while时卡住了)。我猜sum.golang.org和proxy.golang.org可能存在相同的问题。

tzdcorbm

tzdcorbm2#

GOPROXY=direct GOPRIVATE=github.com/ignite/cli GOMODCACHE=/tmp/foo go mod download -x github.com/ignite/cli@v0.24.1-0.20221012132336-dffafa16f6fd 输出

mkdir -p /tmp/foo/cache/vcs # git3 https://github.com/ignite/cli
# lock /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0.lock
mkdir -p /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0 # git3 https://github.com/ignite/cli
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git init --bare
0.003s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git init --bare
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git remote add origin -- https://github.com/ignite/cli
0.005s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git remote add origin -- https://github.com/ignite/cli
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' dffafa16f6fd --
0.003s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' dffafa16f6fd --
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git ls-remote -q origin
0.612s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git ls-remote -q origin
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git tag -l
0.004s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git tag -l
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git fetch -f --depth=1 origin refs/heads/feat/plugin-system-rebased:refs/heads/feat/plugin-system-rebased
10.996s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git fetch -f --depth=1 origin refs/heads/feat/plugin-system-rebased:refs/heads/feat/plugin-system-rebased
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' refs/heads/feat/plugin-system-rebased --
0.002s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' refs/heads/feat/plugin-system-rebased --
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git merge-base --is-ancestor -- v0.24.0 dffafa16f6fd91d9ef4462570038210c518d08dd
0.002s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git merge-base --is-ancestor -- v0.24.0 dffafa16f6fd91d9ef4462570038210c518d08dd
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' dffafa16f6fd91d9ef4462570038210c518d08dd --
0.003s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' dffafa16f6fd91d9ef4462570038210c518d08dd --
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git fetch -f origin 'refs/heads/*:refs/heads/*' 'refs/tags/*:refs/tags/*'
162.735s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git fetch -f origin 'refs/heads/*:refs/heads/*' 'refs/tags/*:refs/tags/*'
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git fetch --unshallow -f origin
1.774s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git fetch --unshallow -f origin
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git merge-base --is-ancestor -- v0.24.0 dffafa16f6fd91d9ef4462570038210c518d08dd
0.004s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git merge-base --is-ancestor -- v0.24.0 dffafa16f6fd91d9ef4462570038210c518d08dd
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git cat-file blob dffafa16f6fd91d9ef4462570038210c518d08dd:go.mod
0.002s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git cat-file blob dffafa16f6fd91d9ef4462570038210c518d08dd:go.mod
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git merge-base --is-ancestor -- v0.24.0 dffafa16f6fd91d9ef4462570038210c518d08dd
0.003s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git merge-base --is-ancestor -- v0.24.0 dffafa16f6fd91d9ef4462570038210c518d08dd
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git cat-file blob dffafa16f6fd91d9ef4462570038210c518d08dd:go.mod
0.003s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git cat-file blob dffafa16f6fd91d9ef4462570038210c518d08dd:go.mod
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git cat-file blob dffafa16f6fd91d9ef4462570038210c518d08dd:go.mod
0.003s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git cat-file blob dffafa16f6fd91d9ef4462570038210c518d08dd:go.mod
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git merge-base --is-ancestor -- v0.24.0 dffafa16f6fd91d9ef4462570038210c518d08dd
0.003s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git merge-base --is-ancestor -- v0.24.0 dffafa16f6fd91d9ef4462570038210c518d08dd
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git cat-file blob dffafa16f6fd91d9ef4462570038210c518d08dd:go.mod
0.002s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git cat-file blob dffafa16f6fd91d9ef4462570038210c518d08dd:go.mod
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git cat-file blob dffafa16f6fd91d9ef4462570038210c518d08dd:go.mod
0.002s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git cat-file blob dffafa16f6fd91d9ef4462570038210c518d08dd:go.mod
cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ dffafa16f6fd91d9ef4462570038210c518d08dd
9.448s # cd /tmp/foo/cache/vcs/34eb0ee23d95bbac94a613041a01736e397aac7df846b18804e1b27d755c43b0; git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ dffafa16f6fd91d9ef4462570038210c518d08dd

我确认在我机器上它也很长。
这个仓库最近收到了很多带有大型二进制文件的提交,你觉得这是404的原因吗?如果sumdb因为那个超时,我本应该得到一种不同的错误。

9gm1akwq

9gm1akwq3#

如果在缓存过期后我请求sumdb,我会得到一个略有不同的错误标签(仍然是404):

$ curl https://sum.golang.org/lookup/github.com/ignite/cli@v0.24.1-0.20221012132336-dffafa16f6fd
not found: fetch timed out

看起来确实是一个超时问题!

hpcdzsge

hpcdzsge4#

#57185 代表现在正在发生的事情。

ssm49v7z

ssm49v7z5#

我的团队昨天遇到了这个问题,但是花了一段时间才弄清楚这是个问题。如果没有立即的解决方案,在错误信息中给出一些提示,表明仓库可能太大,可以节省一些时间,尤其是当错误目前只是 server response: not found: 时。

kx5bkwkv

kx5bkwkv6#

我在Go构建器的cmd/go回归测试中也看到过一些这样的情况;我将这些文件归类为#64016

ddarikpa

ddarikpa7#

我遇到了未找到错误,但如果你检查一下仓库是否已经存在,这里是 https://github.com/ubgo/gofm/releases/tag/ginserver%2Fv0.0.9

tst go get github.com/ubgo/gofm/ginserver@v0.0.9                             
go: downloading github.com/ubgo/gofm/ginserver v0.0.9
go: github.com/ubgo/gofm/ginserver@v0.0.9: verifying module: github.com/ubgo/gofm/ginserver@v0.0.9: reading https://sum.golang.org/lookup/github.com/ubgo/gofm/ginserver@v0.0.9: 404 Not Found
	server response:
	not found: github.com/ubgo/gofm/ginserver@v0.0.9: invalid version: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/7f2330e9251df817986bc960f2658c75dcadbfc629e4df795b6b857268f84e8f: 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.
k7fdbhmy

k7fdbhmy8#

我相信我遇到了同样的问题。尽管https://github.com/alexaandru/go-sitter-forest/tree/bash/v1.5.11明显存在(大约30分钟了),但go get github.com/alexaandru/go-sitter-forest/bash@latestgo get github.com/alexaandru/go-sitter-forest/bash@v1.5.11都无法通过server response: not found: github.com/alexaandru/go-sitter-forest/bash@v1.5.11: invalid version: unknown revision bash/v1.5.11
这个仓库确实非常大(1.3GB),但其中的每个文件夹都是独立的Go模块。Bash文件夹本身只有10MB,而.git文件夹本身约为130MB。
更新:5分钟后,它终于可以工作了! :-)

相关问题