Skip to content

audit reports success with 0 pages when the content store cannot be opened #403

Closed

Description

@nc9

SQUIRREL_CONTENT_STORE_PATH is a file path (it defaults to content-store.db). Point it at a directory and the audit still reports success, having stored nothing.

Repro:

mkdir -p /tmp/cs-dir
SQUIRREL_CONTENT_STORE_PATH=/tmp/cs-dir squirrel audit https://example.com -m 3 --http --offline -r --debug

Observed (v0.0.97):

debug request {"url":"https://…/","method":"GET","status":200,"ttfb":355}
debug stream batch 5 pages (avg page 0 B, budget 48 MB)
debug audit complete pages=0
debug entity map stored 0 nodes, 0 edges, 0 occurrences
✓ Audited 0 pages in 13.4s

Pages fetch with HTTP 200 and then store as 0 bytes. The run exits 0, prints the success tick, and avg page 0 B in a debug line is the only signal that anything is wrong. Without --debug there is nothing at all.

Two things make this worse than a confusing error message:

  • The same run online charges the 50 credit audit base for an audit that produced nothing. (Observed on a non---offline run of the same shape.)
  • It is indistinguishable from a site that genuinely blocked the crawl. I spent a while concluding a site was blocking us before finding the real cause was my own path.

Opening the store is a precondition for the whole audit, so it should fail loudly at open rather than degrade to a silent no-op.

Acceptance Criteria

  • A SQUIRREL_CONTENT_STORE_PATH that cannot be opened as a SQLite database (a directory, an unwritable path, a corrupt file) aborts the audit before crawling, with an error naming the path and what was wrong with it
  • A run that aborts this way exits non-zero and charges no credits
  • A store that fails mid-run surfaces as a run failure rather than a success with fewer pages
  • A test asserts the abort for a directory path and for an unwritable path
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

    P2bugsize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions