go
module_error
ai_generated
true
go: 模块 github.com/foo/[email protected]: 读取 https://proxy.golang.org/.../v1.2.3.mod: 404 未找到
go: module github.com/foo/[email protected]: reading https://proxy.golang.org/github.com/foo/bar/@v/v1.2.3.mod: 404 Not Found
ID: go/module-not-found-reading-https-proxy
80%修复率
88%置信度
0证据数
2024-02-11首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 1.16+ | active | — | — | — |
| 1.21+ | active | — | — | — |
根因分析
所请求的模块版本在代理上不存在,或模块路径拼写/大小写错误。Go 模块路径区分大小写,且需要精确的 tag(如 v1.2.3,而非 v1.2)。
English
The module version does not exist on the configured proxy or the module path is wrong/mis-cased. Go module paths are case-sensitive and require the exact tag (e.g. v1.2.3, not v1.2).
解决方案
-
95% 成功率
git ls-remote --tags https://github.com/foo/bar | grep v1.2.3 go get github.com/foo/[email protected]
-
90% 成功率
GOPRIVATE=github.com/foo/* GONOSUMDB=github.com/foo/* GOPROXY=direct go get github.com/foo/[email protected]
-
80% 成功率
go get github.com/foo/bar@<commit-sha>
无效尝试
常见但无效的做法:
-
70% 失败
go still needs to resolve the original module graph and reports 'replacement directory does not exist'
-
85% 失败
clearing cache does not create a missing version on the proxy
-
90% 失败
does not change remote availability of the module version