Docs/Build a dataset

Read reports and errors

Interpret every job counter, distinguish row and page failures, and decide what output is ready to use.

Download .md
Everyone3 min read5 sections
Source reference · Match your SDK version. Availability and known issues
In this guide

A report from the local product example

The example processes three input lines referring to two distinct pages. Its returned report includes cumulative counters, the committed shard count and the state of this invocation. The elapsed time below is illustrative because timing changes between runs.

{
  "source_lines": 3,
  "pages_fetched": 2,
  "pages_failed": 0,
  "duplicate_urls": 1,
  "records_written": 2,
  "records_rejected": 1,
  "duplicate_records": 1,
  "shards": 1,
  "complete": true,
  "cancelled": false,
  "elapsed_ms": 447
}
json13 lines · copy-ready

Counter reference

A page can produce many rows, so records_written is not expected to equal pages_fetched. Duplicate URLs and duplicate records describe different operations. On resume, cumulative counts remain; the elapsed time and invocation state describe the latest run.

FieldHow to read it
source_linesInput lines consumed by committed work; this is not a unique URL or record count.
pages_fetchedPages successfully processed through fetching and extraction.
pages_failedPage-level failures, including fetch failures or a missing required row container.
duplicate_urlsInput URLs skipped because their identities were already seen.
records_writtenAccepted, nonduplicate records committed to data shards.
records_rejectedRows that did not pass extraction/validation requirements.
duplicate_recordsValid rows skipped by exact record identity.
shardsNumber of committed data/error shard pairs. Use this boundary when consuming a completed invocation.
completeThe input reached its end. This can be true when failure/rejection counts are nonzero.
cancelledThis invocation received a cancellation request. Resume with a new instance.
elapsed_msWall time for this invocation, including restart validation; not cumulative job time.

Read the error shards

For each committed data shard there is a corresponding part-XXXXXXXX.errors.jsonl file. Read each line as a separate JSON object. Page-level errors identify the URL; row errors also identify the zero-based row index. The error text supplies the reason.

Treat error messages as diagnostics rather than a stable machine-readable taxonomy. Applications should use report counters for high-level decisions and preserve the original error objects for review.

{
  "error": "Dataset error: missing required field 'name'",
  "row": 2,
  "url": "http://127.0.0.1:8765/catalog.html"
}
json5 lines · copy-ready

Classify the outcome

The CLI returns 0 for a clean completion, 2 for cancellation or reported page/row failures, and 1 for a fatal error. An SDK returns a report or raises/rejects on a fatal error; it does not choose your application’s exit code.

Observed stateInterpretationNext action
complete=true, no page/row errorsInput completed without reported page or row failures.Review data quality and use the committed shards.
complete=true, errors presentInput completed with partial results.Inspect errors and decide whether the partial dataset is acceptable.
cancelled=trueThe invocation stopped before finishing all work.Wait for the writer to release storage; resume unchanged input/config.
Exception / CLI status 1The job could not finish normally.Investigate the error and storage state before consuming output.
Process killed or machine restartedThe report may not describe the last written files.Resume first to reconcile state and output.

Retry deliberately

Resuming a finished job is not a retry queue. Failed URLs already committed to its checkpoint are not fetched again. After fixing a selector, source problem or request policy, build a new input file containing the URLs you want to revisit and use a new output directory.

Decide how the corrected output will be reconciled with the earlier dataset. Merging two jobs is an application operation: choose which record wins and how identity is applied. Do not merge state databases or append files into an existing job directory by hand.