Skip to content

audit -f json: unreachable start URL exits 1 with no report; write a status=unreachable report instead #1269

Closed

Description

@nc9

squirrel audit <url> -f json -o out.json exits 1 and writes no file when the start URL can't be reached: DNS failure (getaddrinfo ENOTFOUND), connection timeout, ECONNRESET, or a TLS hostname mismatch (ERR_TLS_CERT_ALTNAME_INVALID). The only signal is a ✗ Cannot reach <url> ... line on stderr.

A batch caller then can't tell "the site is down" from "the CLI crashed" without scraping stderr. A blocked site, by contrast, already gets a JSON report with status: "blocked" and a reason code.

Seen in a 656-site batch run on v0.0.140 (linux-x64, --offline --passive, concurrency 8): 11 of 13 "exit 1, no report" outcomes were unreachable sites. The remaining 2 were a site that throttled the crawl early; re-run alone, the same URL completed (exit 0).

Acceptance Criteria

  • With -f json -o <file>, an unreachable start URL (DNS failure, connect timeout, connection reset, TLS error) writes a JSON report with status: "unreachable", a statusReasonCode that names the class (e.g. dns, timeout, connection_reset, tls), and the underlying error text in statusReason.

  • The exit code for an unreachable site is distinct from a crash, and documented on the CLI exit-codes docs page (as blocked is).

  • A test covers each class: DNS, timeout, reset and TLS.

  • Docs are updated in the same PR.

  • Every report with status: "blocked" exits 3, whether or not a WAF vendor is identified (a bare 403/429 "Request blocked by server" today exits 1). The exit-code table says so.

Activity

  1. added
    bug
    on Oct 29, 2026
  2. added theissue type on Oct 29, 2026
  3. nc9 commented on Oct 29, 2026

    @nc9
    ContributorAuthor

    A related case from the same corpus run (v0.0.141, cloud renders with --render-mode all): a report with status: "blocked" exits 1 when the block isn't attributed to a known vendor (statusReason: "...: Request blocked by server", a bare 403/429). It exits 3 when the WAF is recognised (blocked_by_cloudflare, blocked_by_datadome). Of 18 cloud-blocked sites, 10 exited 1 and 8 exited 3.

    The docs table says this is intended (1 = "down/blocked site"), but a batch caller then can't tell an unattributed block from a crash by exit code. Suggested addition to this issue's exit-code mapping: exit codes follow the report's status (blocked → 3, with wafBlocked.providers empty or unknown when no vendor is identified, and unreachable → its own code), so the code and the JSON never disagree.

    • Every report with status: "blocked" exits 3, whether or not a vendor is identified; the docs table says so.
  4. added
    size: S
    size: M
    on Oct 29, 2026
  5. nc9 commented on Oct 30, 2026

    @nc9
    ContributorAuthor

    Fixed in v0.0.142 (a8acade5), via the stacked release PR #1331.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclisize: Msize: S

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions