Show only failed network system calls from a curl request
Build a paste-ready command, then review its compatibility and effects before running it.
strace -f -e trace=%network -e status=failed curl <url>Complete required fields to copy the generated command.
Compatibility
Recent straceThe status=failed filter requires a strace release that supports syscall return-status filtering.
Runs curlThis performs the supplied curl request under strace; review the URL before copying.
Operational knowledgereview due 2027-01-19
Requirementsstracestrace must be installed and available on PATH.Network accessThe target must be reachable from the current environment.
Version supportstrace Current supported releasesVerified for linux using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsconnect(5, {sa_family=AF_INET6, sin6_port=htons(53), inet_pton(AF_INET6, "2001:db8::53", &sin6_addr)}, 28) = -1 ENETUNREACH (Network is unreachable)Representative successful output; values vary with the selected target and system state.
Known errorsstrace: command not foundstrace is missing or is not available on PATH.
Verifystrace -f -e trace=%network -e status=failed curl {{url}}Re-run the corresponding read-only inspection and confirm the intended state.Rollback noteNo universal automatic rollback is available. Capture the current state and use the tool-specific recovery procedure before applying changes.
Command breakdown
01straceCommandRuns the strace stage of this one-liner.
02-fOptionFollows child processes and threads created by the traced process.
03-eOptionApplies the following syscall trace or return-status filter expression.
04trace=%networkArgumentPasses trace=%network to strace.
05-eOptionApplies the following syscall trace or return-status filter expression.
06status=failedArgumentPasses status=failed to strace.
07curlArgumentPasses curl to strace.
08<url>ParameterA value supplied in the Fill parameters section.
Example input
strace -f -e trace=%network -e status=failed curl https://example.com
Example output
connect(5, {sa_family=AF_INET6, sin6_port=htons(53), inet_pton(AF_INET6, "2001:db8::53", &sin6_addr)}, 28) = -1 ENETUNREACH (Network is unreachable)
+++ exited with 6 +++
Illustrative output — exact values vary by system and data.
Official sources
Related commands