curl Exit Code 7 in CI: Failed to Connect to Host
curl exit code 7 means "failed to connect to host" - DNS worked but the TCP connection could not be established.
A step exiting 7 from curl resolved the host but could not open a connection: the port was closed, refused, or unreachable.
What it means
Exit 7 is curl's CURLE_COULDNT_CONNECT. The address resolved but the connection attempt failed - connection refused, no route, or a firewall drop.
Common causes
- The target service is not yet up (race in CI startup).
- A firewall or security group blocks the port.
- A wrong port or scheme.
How to fix it
Confirm the service is listening on the expected port and reachable from the runner. Add a readiness wait before the request. A service still starting up often succeeds on retry.
Related guides
Exit Codes and Signals in CI/CD: A Practical GuideA practical guide to process exit codes and signals in CI/CD - what 1, 2, 124, 126, 127, 130, 137, and 143 me…
CI Exit Code Lookup: What Does This Exit Code Mean?Instant lookup for CI/CD process exit codes - enter a code (137, 127, 143…) to see what it means, whether it…