Skip to content

An --update pass overwrites the previous WARC and leaves a page-less WACZ #759

Description

@xroche

A second crawl into the same output with --warc-file replaces the previous archive instead of adding to it, so the bodies the first crawl captured are gone, and the --wacz package built from it comes out empty.

Measured on master + #754, against tests/server-root/mini304:

httrack -O out URL/mini304/index.html --warc-file warc-out --wacz
  warc-out.warc.gz  3 response + 3 request + warcinfo
  warc-out.wacz     pages.jsonl has 2 page rows

httrack -O out URL/mini304/index.html --warc-file warc-out --wacz --update
  warc-out.warc.gz  1 response (robots.txt) + 2 revisit + warcinfo, file replaced
  warc-out.wacz     pages.jsonl has 0 page rows

After the update pass the revisit records point at payloads that exist nowhere, and a replay tool opening the WACZ finds no pages at all. warc_wacz_package() already keeps the existing package when the build fails ("kept existing %s untouched"), but nothing notices that the package it is about to move into place carries no pages.

This is why 74_local-warc-wacz.test drives its second pass with --rerun-args '-C0' instead of --rerun: a cacheless pass re-downloads and produces a real package, while the update pass produces one that fails wacz-validate with "pages.jsonl has no page rows after the header". The workaround is in the test because the test needed a second package to clobber, not because the update behaviour is fine.

tests/local-crawl.sh already snapshots the first-pass .warc.gz before a rerun for the same reason, so the overwrite has been known at the test level for a while without being decided at the engine level.

What --update should mean for WARC output is the actual question: append to the existing archive, write a new segment per run the way --warc-max-size already does, or refuse to overwrite an archive holding records the new run does not have.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions