go
io_error
ai_generated
true
write /dev/stdout: broken pipe
ID: go/io-copy-write-error
80%Fix Rate
82%Confidence
0Evidence
2024-04-22First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.21 | active | — | — | — |
Root Cause
Attempting to write to a closed or broken pipe, often when the reader (e.g., head command) exits early.
generic中文
尝试写入已关闭或破裂的管道,通常当读取方(如 head 命令)提前退出时发生。
Workarounds
-
80% success
_, err := io.Copy(dst, src); if err != nil { if errors.Is(err, syscall.EPIPE) { /* handle gracefully */ } else { log.Fatal(err) } }
Dead Ends
Common approaches that don't work:
-
90% fail
The pipe remains broken; retries will fail repeatedly.
-
85% fail
May hide critical I/O issues and lead to data loss.