go
io_error
ai_generated
true
go: 创建模块缓存目录:mkdir /go/pkg/mod: 只读文件系统
go: creating module cache directory: mkdir /go/pkg/mod: read-only file system
ID: go/read-only-file-system
80%修复率
86%置信度
0证据数
2024-06-20首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 1.13 | active | — | — | — |
| 1.20 | active | — | — | — |
根因分析
Go 模块缓存目录位于只读文件系统上,常见于容器化环境。
English
The Go module cache directory is on a read-only file system, often in containerized environments.
解决方案
-
95% 成功率
GOMODCACHE=/tmp/gomodcache go mod download
-
70% 成功率
mount -o remount,rw /go
无效尝试
常见但无效的做法:
-
90% 失败
If the file system is truly read-only (e.g., squashfs), chmod won't work.
-
80% 失败
Even root cannot write to a read-only file system unless remounted.