go
data_error
ai_generated
true
go: github.com/foo/[email protected]: 打开 /root/go/pkg/mod/cache/download/github.com/foo/bar/@v/v1.0.0.zip: 没有那个文件或目录
go: github.com/foo/[email protected]: open /root/go/pkg/mod/cache/download/github.com/foo/bar/@v/v1.0.0.zip: no such file or directory
ID: go/module-cache-corrupt
80%修复率
84%置信度
0证据数
2024-09-12首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 1.15 | active | — | — | — |
| 1.21 | active | — | — | — |
根因分析
模块缓存损坏或不完整,通常由于下载中断或手动删除。
English
The module cache is corrupted or incomplete, often due to interrupted downloads or manual deletion.
解决方案
-
90% 成功率
go clean -modcache github.com/foo/bar
-
95% 成功率
rm -rf $(go env GOMODCACHE) && go mod download
无效尝试
常见但无效的做法:
-
40% 失败
If the cache is corrupted, Go may still use the corrupted entry unless you clean it.
-
80% 失败
The hash may not match, causing checksum errors.