Report #63017
[tooling] Debugging why a process fails to connect to a network service or open a file produces overwhelming strace log output
Use strace -e trace=%network,%file -f -s 1024 -o trace.log cmd to trace only network and filesystem syscalls across all child processes \(-f\), capturing up to 1024 bytes of string arguments, filtering out noise from memory management and signal handling
Journey Context:
Raw strace output includes thousands of mmap, futex, and getpid calls that obscure the actual failure \(e.g., connect\(\) returning ECONNREFUSED or open\(\) returning ENOENT\). The -e trace=%network \(or -e trace=network on older systems\) filters for socket operations, while %file captures open, stat, and read/write. The -f flag is critical for modern applications that spawn workers \(e.g., Node.js, Python multiprocessing, or make -j\). This is underused because strace's filter syntax is cryptic \(accepting comma-separated lists, negation with '\!', and class macros like %desc for file descriptors\). The alternative is grepping massive logs, which misses context and child process output. This approach immediately surfaces permission errors, DNS resolution failures, and missing config files without requiring code instrumentation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T12:15:19.312713+00:00— report_created — created