go验证模块失败(go sumsdb如何工作?)

huangapple go评论73阅读模式
英文:

go verify module failed (how does go sumsdb work?)

问题

我在go build时遇到了这个错误:

go: github.com/frankban/quicktest@v1.14.2: 验证模块: github.com/frankban/quicktest@v1.14.2: 获取"https://sum.golang.org/lookup/github.com/frankban/quicktest@v1.14.2"时出错: 未找到

我的问题是,为什么在sum数据库中找不到frankban/quicktest?实际上,这不是唯一导致此错误的包,上次我尝试编译相同的项目(大约一个小时前),错误出现在golang.org/x/xerrors上。

此外,有人能解释一下Go模块系统的"sums db"是如何工作的吗?如果遇到这样的错误,似乎没有什么可以做来修复它,这让人非常沮丧。

完整日志:

$ go get -u
go: 下载 github.com/tealeg/xlsx v1.0.5
go: 下载 github.com/shabbyrobe/xmlwriter v0.0.0-20220218224045-defe0ad214f6
go: 下载 github.com/frankban/quicktest v1.14.2
go: 下载 golang.org/x/text v0.3.3
go: 下载 github.com/google/btree v1.0.1
go: 下载 github.com/kr/pretty v0.3.0
go: 下载 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
go: 下载 github.com/kr/text v0.2.0
go: github.com/frankban/quicktest@v1.14.2: 验证模块: github.com/frankban/quicktest@v1.14.2: 获取"https://sum.golang.org/lookup/github.com/frankban/quicktest@v1.14.2"时出错: 未找到
go: github.com/google/btree@v1.0.1: 验证模块: github.com/google/btree@v1.0.1: 获取"https://sum.golang.org/lookup/github.com/google/btree@v1.0.1"时出错: 未找到
go: github.com/kr/pretty@v0.3.0: 验证模块: github.com/kr/pretty@v0.3.0: 获取"https://sum.golang.org/lookup/github.com/kr/pretty@v0.3.0"时出错: 未找到
go: github.com/kr/text@v0.2.0: 验证模块: github.com/kr/text@v0.2.0: 获取"https://sum.golang.org/lookup/github.com/kr/text@v0.2.0"时出错: 未找到
go: github.com/shabbyrobe/xmlwriter@v0.0.0-20220218224045-defe0ad214f6: 验证模块: github.com/shabbyrobe/xmlwriter@v0.0.0-20220218224045-defe0ad214f6: 获取"https://sum.golang.org/lookup/github.com/shabbyrobe/xmlwriter@v0.0.0-20220218224045-defe0ad214f6"时出错: 未找到
英文:

I encountered this error on go build:

go: github.com/frankban/quicktest@v1.14.2: verifying module: github.com/frankban/quicktest@v1.14.2: Get "https://sum.golang.org/lookup/github.com/frankban/quicktest@v1.14.2": Not Found

My question is, why the frankban/quicktest is not found in sum db? as a matter of fact this is not the only package that caused this error, last time I try to compile the same project (about an hour ago), the error was on golang.org/x/xerrors.

Further more, could anyone explain (or point out some documents/articles/blogs) on how the go module system's "sums db" work. It is very frustrating if anyone encounter such error as there seems nothing you can do to fix it?

Full log:

$ go get -u
go: downloading github.com/tealeg/xlsx v1.0.5
go: downloading github.com/shabbyrobe/xmlwriter v0.0.0-20220218224045-defe0ad214f6
go: downloading github.com/frankban/quicktest v1.14.2
go: downloading golang.org/x/text v0.3.3
go: downloading github.com/google/btree v1.0.1
go: downloading github.com/kr/pretty v0.3.0
go: downloading golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
go: downloading github.com/kr/text v0.2.0
go: github.com/frankban/quicktest@v1.14.2: verifying module: github.com/frankban/quicktest@v1.14.2: Get "https://sum.golang.org/lookup/github.com/frankban/quicktest@v1.14.2": Not Found
go: github.com/google/btree@v1.0.1: verifying module: github.com/google/btree@v1.0.1: Get "https://sum.golang.org/lookup/github.com/google/btree@v1.0.1": Not Found
go: github.com/kr/pretty@v0.3.0: verifying module: github.com/kr/pretty@v0.3.0: Get "https://sum.golang.org/lookup/github.com/kr/pretty@v0.3.0": Not Found
go: github.com/kr/text@v0.2.0: verifying module: github.com/kr/text@v0.2.0: Get "https://sum.golang.org/lookup/github.com/kr/text@v0.2.0": Not Found
go: github.com/shabbyrobe/xmlwriter@v0.0.0-20220218224045-defe0ad214f6: verifying module: github.com/shabbyrobe/xmlwriter@v0.0.0-20220218224045-defe0ad214f6: Get "https://sum.golang.org/lookup/github.com/shabbyrobe/xmlwriter@v0.0.0-20220218224045-defe0ad214f6": Not Found

答案1

得分: 0

sum.golang.org服务器需要一些时间来更新哈希值。现在再试一次。对我来说一切都正常:

$ GO111MODULE=on go get github.com/shabbyrobe/xmlwriter@v0.0.0-20220218224045-defe0ad214f6
go: 正在下载 github.com/shabbyrobe/xmlwriter v0.0.0-20220218224045-defe0ad214f6
go: 正在下载 golang.org/x/text v0.3.2
$ curl https://sum.golang.org/lookup/github.com/shabbyrobe/xmlwriter@v0.0.0-20220218224045-defe0ad214f6
9249991
github.com/shabbyrobe/xmlwriter v0.0.0-20220218224045-defe0ad214f6 h1:ri617veNyNwEMXywzcLmU//YIVSFdJvdk39lNsFB/Ro=
github.com/shabbyrobe/xmlwriter v0.0.0-20220218224045-defe0ad214f6/go.mod h1:tKYSeHyJGYz7eoZMlzrRDQSfdYPYt0UduMr8b97Mmaw=

go.sum 数据库树
9690070
OufFSNsOUYeDJ2VPyrxBAe7/d47lQYkE03JZL2ltaI8=

— sum.golang.org Az3grkvrWUkW3Rvnl5QL72oZpiY5ifJhab3/evZCb0hmRkEtGRE/tCMyFDXftZWFi2SF71EuHAxJMTgLd1laHabOzAE=
英文:

The sum.golang.org server needs some time to update the hash sum. Try again now. Everything works correctly for me:

$ GO111MODULE=on go get github.com/shabbyrobe/xmlwriter@v0.0.0-20220218224045-defe0ad214f6
go: downloading github.com/shabbyrobe/xmlwriter v0.0.0-20220218224045-defe0ad214f6
go: downloading golang.org/x/text v0.3.2
$ curl https://sum.golang.org/lookup/github.com/shabbyrobe/xmlwriter@v0.0.0-20220218224045-defe0ad214f6
9249991
github.com/shabbyrobe/xmlwriter v0.0.0-20220218224045-defe0ad214f6 h1:ri617veNyNwEMXywzcLmU//YIVSFdJvdk39lNsFB/Ro=
github.com/shabbyrobe/xmlwriter v0.0.0-20220218224045-defe0ad214f6/go.mod h1:tKYSeHyJGYz7eoZMlzrRDQSfdYPYt0UduMr8b97Mmaw=

go.sum database tree
9690070
OufFSNsOUYeDJ2VPyrxBAe7/d47lQYkE03JZL2ltaI8=

— sum.golang.org Az3grkvrWUkW3Rvnl5QL72oZpiY5ifJhab3/evZCb0hmRkEtGRE/tCMyFDXftZWFi2SF71EuHAxJMTgLd1laHabOzAE=

huangapple
  • 本文由 发表于 2022年3月21日 17:19:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/71555243.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定