[Bug]: Pipeline ignores files owned by root with "still being written or locked" (v2.14.3)

Author: ryswork1993Created Aug 28, 2026Updated Sep 25, 2026

Environment:

  • Stirling PDF 2.14.3
  • Docker, with pipeline volume mounted from host (uid mismatch)
  • Host UID: 1000 (brodata) vs Container UID: 1000 (ubuntu) — but files cp'd via sudo end up owned by root

Bug Description:

When uploading PDFs to /pipeline/watchedFolders/<task>/ via host-side sudo cp (required due to mounted volume permissions), the resulting files are owned by root:root inside the container (because sudo writes as root).

Stirling's PipelineDirectoryProcessor then refuses to process them indefinitely:

INFO s.s.S.c.a.p.PipelineDirectoryProcessor - File 'test.pdf' is not yet ready for processing (still being written or locked), will retry on next scan cycle

This persists across every 60-second scan cycle even though the file is fully written and not locked. Repro'd continuously for 5+ minutes with no change.

Log evidence (5 retries in a row):

09:42:21 - File 'test.pdf' is not yet ready for processing (still being written or locked), will retry on next scan cycle
09:43:17 - File 'test.pdf' is not yet ready for processing (still being written or locked), will retry on next scan cycle
09:44:17 - File 'test.pdf' is not yet ready for processing (still being written or locked), will retry on next scan cycle
09:45:17 - File 'test.pdf' is not yet ready for processing (still being written or locked), will retry on next scan cycle
09:46:17 - File 'test.pdf' is not yet ready for processing (still being written or locked), will retry on next scan cycle

Workaround (confirmed working): After sudo cp file.pdf ..., also sudo chown 1000:1000 file.pdf. As soon as owner becomes uid 1000 (ubuntu), Stirling processes the file immediately on the next scan cycle.

Root cause analysis: stirling.software.common.util.FileReadinessChecker (referenced in PipelineDirectoryProcessor.class) appears to check:

  • File size stability (✅ not the issue here)
  • File mtime age (✅ file is hours old)
  • File owner == running process uid (❌ likely the culprit)

But since mounted volumes can show any uid as 1000, this check is unreliable.

Steps to reproduce:

  1. Mount a host directory as /pipeline/watchedFolders
  2. From host: sudo cp test.pdf /pipeline/watchedFolders/pdf-to-word/test.pdf
  3. From container: ls -la /pipeline/watchedFolders/pdf-to-word/test.pdf → shows root:root
  4. Wait for next Pipeline scan cycle
  5. Observe log: file ignored indefinitely

Expected: Stirling processes the file regardless of owner, as long as it has read permission

Actual: Stirling silently ignores the file forever (or until manual chown)

Suggested fix:

  • FileReadinessChecker should not check file owner
  • OR: Better error message ("file owned by root, run as ubuntu user") instead of "still being written or locked"
  • OR: Add a configurable pipeline.allowedFileOwners list with sane defaults

Source: Stirling-Tools/Stirling-PDF