Skip to content

fix(pipeline): fail fast when the provenance store cannot persist records#662

Merged
ddeboer merged 1 commit into
mainfrom
fix/provenance-file-writability
Jul 25, 2026
Merged

fix(pipeline): fail fast when the provenance store cannot persist records#662
ddeboer merged 1 commit into
mainfrom
fix/provenance-file-writability

Conversation

@ddeboer

@ddeboer ddeboer commented Jul 25, 2026

Copy link
Copy Markdown
Member

Fix #661

The search-indexer image runs as node (uid 1000) but wrote PROVENANCE_FILE without ensuring its directory is writable by that user. On a root-owned mount – the default for a fresh named volume – every provenance write failed silently (the pipeline swallowed write errors), so skip-unchanged never engaged and every run reprocessed the full dataset.

Changes

Fail fast at run start (@lde/pipeline)

  • ProvenanceStore gains an optional check(); the pipeline calls it once at the start of a run, before selecting datasets. A store that would fail every write now fails the run immediately with a clear error instead of silently disabling skip-unchanged.

  • FileProvenanceStore.check() probes the file’s directory with a real write (create + remove a probe file), catching exactly the root-owned-volume case:

    Provenance file /state/provenance.json is not writable; make its directory
    writable by the user the pipeline runs as: Error: EACCES: permission denied, …
    

Surface mid-run write failures (@lde/pipeline)

  • A record write that fails mid-run (e.g. disk full) is still non-fatal – the dataset simply reprocesses next run – but is now reported through the reporter (stageFailed, stage 'provenance') instead of being swallowed.

Make the natural configuration just work (search-indexer image)

  • The image pre-creates /provenance owned by node, like /data. A fresh named volume mounted there inherits that ownership, so PROVENANCE_FILE=/provenance/provenance.json with -v provenance:/provenance works out of the box. Bind mounts still need a host-side chown, which the boot error now points out.

READMEs of both packages document the writability requirement.

Verification

Beyond the unit tests, verified against the built image:

  • ls -ld /provenancedrwxr-xr-x node node; with a fresh named volume mounted at /provenance, uid 1000 can create provenance.json (the issue’s failing scenario).
  • Booting the image with PROVENANCE_FILE on a root-owned mount now exits 1 with the error above instead of completing “successfully” without a provenance file.

…ords

- Add an optional check() to ProvenanceStore; the pipeline calls it once
  at the start of a run, so a store that would fail every write fails
  the run immediately instead of silently disabling skip-unchanged
- FileProvenanceStore.check() probes the file's directory with a real
  write, catching a mount the runtime user cannot write to
- Report a record write that fails mid-run through the reporter
  (stageFailed, stage 'provenance') instead of swallowing it
- search-indexer image: pre-create /provenance owned by the runtime
  user, so a fresh named volume mounted there is writable by uid 1000
@ddeboer
ddeboer merged commit 7425411 into main Jul 25, 2026
2 checks passed
@ddeboer
ddeboer deleted the fix/provenance-file-writability branch July 25, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

search-indexer image (uid 1000) silently fails to write PROVENANCE_FILE to a root-owned dir, disabling skip-unchanged

1 participant