Repository navigation
Description
Follow-up to #37/#38/#39, on nf-spawn 0.2.10. #39's permission fix works (no more "Permission denied"; versions.yml writes). But the declared-input staging from #38 still doesn't land the file — and reading the actual generated staging script off the head node shows two concrete bugs in buildInputStaging's emitted commands.
Here are the verbatim stage-in lines nf-spawn 0.2.10 generated for a FASTQC task (task.getInputFilesMap() had the two read files):
# Localize declared inputs by source URI (#37 — they live outside this work dir).
aws s3 cp 's3:///scttfrdmn-microbiome-demo/work/microbiome-demo/fetch/21/e736.../SRR059375_stool_1.fastq.gz' '${LOCAL_DIR}/SRR059375_stool_1.fastq.gz' --region "${AWS_REGION}" --quiet
aws s3 cp 's3:///scttfrdmn-microbiome-demo/work/microbiome-demo/fetch/21/e736.../SRR059375_stool_2.fastq.gz' '${LOCAL_DIR}/SRR059375_stool_2.fastq.gz' --region "${AWS_REGION}" --quietBug 1 — malformed s3:/// (three slashes, empty bucket/authority)
The source is s3:///scttfrdmn-microbiome-demo/work/... — three slashes. The bucket has landed in the path instead of the authority, so aws s3 cp parses an empty bucket and the copy fails. buildInputStaging uses source.toUri().toString(); for the S3 Path (nf-amazon) toUri() is rendering with an empty authority. Need to reconstruct the URI as s3://<bucket>/<key> — e.g. pull bucket from the path's first segment, or build from the filesystem's authority rather than toUri().toString() directly.
Bug 2 — ${LOCAL_DIR} is single-quoted in the destination, so it never expands
The dest is '${LOCAL_DIR}/SRR059375_stool_1.fastq.gz' — single-quoted. shellQuote() wraps the dest in single quotes, but the value still contains a literal shell variable ${LOCAL_DIR}, so the shell passes ${LOCAL_DIR}/... verbatim to aws s3 cp instead of /var/lib/nf-work/.... Even with bug 1 fixed, the file would land in a directory literally named ${LOCAL_DIR}. The ${LOCAL_DIR} prefix needs to be outside the single-quoted span (or the dest assembled so the var expands), the way WORKDIR_S3/AWS_REGION are handled elsewhere.
Why it's silent
The staging script is set -uo pipefail (not set -e), so a failed aws s3 cp (not part of a pipe) doesn't abort. The script continues, .command.sh runs, FASTQC finds no input → "Skipping '…raw_1.gz' which didn't exist", exits 0, produces no *.html, and Nextflow then fails the task with MissingFileException: Missing output file(s) *.html. So the trace shows FAILED but the real cause is upstream of the tool. Consider set -e (or an explicit check) around the stage-in copies so a failed input copy fails loud.
Good news in the same run
- Task container ignores
docker.runOptionsand runs as non-root in a root-owned work dir → "Permission denied" #39 permission fix confirmed — container honored--user root/writable workdir,versions.ymlwrote. - The aarchbio arm64 container ran natively (no exec-format-error).
- Stage-name identity is correct: FETCH_FASTQ emits
SRR059375_stool_1.fastq.gz, and.command.shsymlinks against exactly that — so once the copy URL/dest are fixed, this should progress.
Env
nf-spawn 0.2.10, Nextflow 26.04.x, AL2023 arm64, workDir = s3://…, nf-amazon 2.8.0, inputs are s3:// paths from a samplesheet (taxprofiler). Observed 2026-06-13 by reading /tmp/nf-spawn-<inst>-*.sh on the head node.
Activity
fix: repair s3:// input URI and expand ${LOCAL_DIR} in stage-in (#41) (…
scttfrdmn commentedon Jun 13, 2026
Fixed and released in v0.2.11 (#42) — ZIP is live: https://github.com/spore-host/nf-spawn/releases/tag/v0.2.11
Thanks for reading the generated script off the head node — that pinned both bugs exactly.
s3:///). NewnormalizeS3Uri()collapses the empty-authoritys3:///bucket/keythat nf-amazon'sPath.toUri().toString()renders down tos3://bucket/key, soaws s3 cpparses a real bucket.${LOCAL_DIR}unexpanded). The dest now keeps${LOCAL_DIR}/outside the single quotes (only the stage name is quoted), so the shell expands it to/var/lib/nf-work/…— same treatment asWORKDIR_S3/AWS_REGION. Fixed for both themkdir -pand theaws s3 cp.|| { echo …; exit 1; }, so a failed stage-in aborts the script loudly instead of letting the task run input-less and surface later as a confusingMissingFileException.35 tests, 0 failures (updated the #37 staging tests to the corrected format + added repair/fail-loud cases).
Bump your
TARGET_NF_SPAWN_VERSIONto0.2.11. With #39 (perms) + #41 (the actual copy) both in, the FASTQC inputs should now land and the task should produce its*.html. If it does, that closes the loop on #37 staging end-to-end — the only thing I'd still expect to watch for is the.gzrename caveat from #37 if a stage name differs from the source basename.