go
io_error
ai_generated
true
go: creating module cache directory: mkdir /go/pkg/mod: read-only file system
ID: go/read-only-file-system
80%Fix Rate
86%Confidence
0Evidence
2024-06-20First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.13 | active | — | — | — |
| 1.20 | active | — | — | — |
Root Cause
The Go module cache directory is on a read-only file system, often in containerized environments.
generic中文
Go 模块缓存目录位于只读文件系统上,常见于容器化环境。
Workarounds
-
95% success
GOMODCACHE=/tmp/gomodcache go mod download
-
70% success
mount -o remount,rw /go
Dead Ends
Common approaches that don't work:
-
90% fail
If the file system is truly read-only (e.g., squashfs), chmod won't work.
-
80% fail
Even root cannot write to a read-only file system unless remounted.