[Bug]: Pipeline ignores files owned by root with "still being written or locked" (v2.14.3)
Environment:
- Stirling PDF 2.14.3
- Docker, with
pipelinevolume mounted from host (uid mismatch) - Host UID: 1000 (brodata) vs Container UID: 1000 (ubuntu) — but files cp'd via
sudoend 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 cycleThis 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 cycleWorkaround (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:
- Mount a host directory as
/pipeline/watchedFolders - From host:
sudo cp test.pdf /pipeline/watchedFolders/pdf-to-word/test.pdf - From container:
ls -la /pipeline/watchedFolders/pdf-to-word/test.pdf→ showsroot:root - Wait for next Pipeline scan cycle
- 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:
FileReadinessCheckershould 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.allowedFileOwnerslist with sane defaults
Source: Stirling-Tools/Stirling-PDF