{"record":{"id":"2e0a0f5b2353a2e7","repo":"nikivdev/code","slug":"unreachable","errorCode":null,"errorMessage":"✗ Unreachable: {}","messagePattern":"✗ Unreachable: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/deploy.rs","lineNumber":3186,"sourceCode":"            &url,\n        ])\n        .output()\n        .context(\"Failed to run curl\")?;\n\n    let elapsed = start.elapsed();\n    let status_str = String::from_utf8_lossy(&output.stdout);\n    let actual_status: u16 = status_str.trim().parse().unwrap_or(0);\n\n    if actual_status == expected_status {\n        println!(\n            \"✓ Healthy (HTTP {} in {:.2}s)\",\n            actual_status,\n            elapsed.as_secs_f64()\n        );\n        Ok(())\n    } else if actual_status == 0 {\n        let stderr = String::from_utf8_lossy(&output.stderr);\n        bail!(\"✗ Unreachable: {}\", stderr.trim());\n    } else {\n        bail!(\n            \"✗ Unhealthy: expected HTTP {}, got {} ({:.2}s)\",\n            expected_status,\n            actual_status,\n            elapsed.as_secs_f64()\n        );\n    }\n}\n","sourceCodeStart":3168,"sourceCodeEnd":3196,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/deploy.rs#L3168-L3196","documentation":"The health check shells out to curl; a parsed status of 0 means curl exited nonzero without producing an HTTP status, i.e. the host could not be reached at all. The trimmed curl stderr (DNS failure, TLS error, connection refused) is included in the message.","triggerScenarios":"curl fails to connect: DNS does not resolve, connection refused/timeout, TLS handshake failure, or curl is missing/unusable so the command errors before any HTTP response.","commonSituations":"Checking a domain before DNS propagates; app not yet started or crashed; wrong port in URL; corporate proxy/firewall blocking outbound requests; running offline.","solutions":["Read the curl stderr in the message and fix the underlying cause (DNS, refused connection, TLS)","Verify the service is actually running and listening on the expected host/port","Re-check after DNS propagation or with the correct URL via --url","Ensure curl is installed and proxy env vars (HTTP(S)_PROXY) are set correctly"],"exampleFix":"// before\nurl = \"http://localhost:9999\"   # nothing listening\n\n// after\nurl = \"http://localhost:8080\"   # app actually bound here","handlingStrategy":"retry","validationCode":"// pre-check reachability before the managed health check\ncurl -sSf --max-time 5 \"$URL\" -o /dev/null || echo \"host unreachable: $URL\"","typeGuard":null,"tryCatchPattern":"// retry with backoff for boot-time unreachability\nfor attempt in 1..=5 {\n    match check_health(url).await {\n        Ok(()) => break,\n        Err(e) if e.to_string().contains(\"Unreachable\") && attempt < 5 => {\n            tokio::time::sleep(Duration::from_secs(2u64.pow(attempt))).await;\n        }\n        Err(e) => return Err(e),\n    }\n}","preventionTips":["Wait for DNS propagation before first health check after deploy","Confirm the service process is up and bound to the expected port","Set --max-time style timeouts and verify proxy env vars","Ensure curl is installed in the check environment (CI images)"],"tags":["network","curl","unreachable","health-check"],"backgroundTag":"connection-refused","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}