go data_error ai_generated true

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

Also available as: JSON · Markdown · 中文
80%Fix Rate
84%Confidence
0Evidence
2024-09-12First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
1.15 active — — —
1.21 active — — —

Root Cause

The module cache is corrupted or incomplete, often due to interrupted downloads or manual deletion.

generic

中文

模块缓存损坏或不完整,通常由于下载中断或手动删除。

Workarounds

  1. 90% success
    go clean -modcache github.com/foo/bar
  2. 95% success
    rm -rf $(go env GOMODCACHE) && go mod download

Dead Ends

Common approaches that don't work:

  1. 40% fail

    If the cache is corrupted, Go may still use the corrupted entry unless you clean it.

  2. 80% fail

    The hash may not match, causing checksum errors.