You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Containerized processes fail exit 126: nf-spawn's docker run can't reach the Docker socket (task user not in docker group) #92
Every containerized process fails exit 126 — nf-spawn's docker run on the task instance can't reach the Docker socket
Running a real DAG (5 processes, each with a pinned container, executor = 'spawn', S3 workDir) on Graviton: every process fails immediately with exit 126 and empty output.
.command.err in the S3 work dir:
docker: permission denied while trying to connect to the Docker daemon socket at
unix:///var/run/docker.sock: ... connect: permission denied.
Diagnosis. nf-spawn runs the process's container via docker runon the task instance (ext.ensureDocker=true installs Docker). But that docker run is invoked as a task user that is not in the docker group, so it can't reach /var/run/docker.sock. Confirmed it's nf-spawn's own invocation, not Nextflow's: the docker command does not appear in .command.run, and setting docker { enabled = true; sudo = true } in nextflow.config (which would make Nextflow's docker use sudo) had no effect — the failure is in nf-spawn's dispatch layer.
Repro: any process with a container directive under executor = 'spawn' on a stock AMI (ext.ensureDocker=true). Both a MAFFT and a MUSCLE process failed identically (exit 126) across two runs.
Workaround that works (documented in our recipe as an honest mitigation, not a fix): loosen the socket on the ephemeral single-use instance via the ext.setup hook, which runs after Docker install and before the task with sudo:
process { ext.setup ='sudo chmod 666 /var/run/docker.sock' }
With that, the same 5-process DAG ran clean (completed=5, all .exitcode==0, outputs landed in S3).
Suggested fix: nf-spawn should run its docker run with sudo (stock cloud AMIs give the instance user passwordless sudo), or add the task user to the docker group during ensureDocker setup in a way that takes effect for the task shell, or run the container as spawn's provisioning does. As shipped, no containerized pipeline runs on a stock AMI without the socket workaround.
Secondary observation (worth a look): instances did not promptly self-terminate. A failed task's instance (exit 126) was still running after the pipeline aborted (I terminated it manually; TTL would eventually reap it), and even a completed task's instance lingered ~1-2 min post-completion. At DAG scale (N instances, N lifecycles) the terminate discipline is worth verifying explicitly rather than assuming — a workflow that fails to signal completion on one branch is how a stranded instance would happen.
Found building the first Shape-F recipe for scientific-codes-cookbook on Graviton (nf-spawn v0.10.0 → installs as 0.8.0, see #91). The DAG itself works once the socket is reachable.
To be explicit about severity and ownership: this is a blocker, not a rough edge — with a container directive under executor = 'spawn' on a stock AMI, no pipeline runs out of the box; every process fails exit 126 with a confusing Docker-socket error that doesn't obviously point at nf-spawn. The ext.setup socket-chmod is a user-side mitigation on the ephemeral instance, not a fix — the fix belongs in the executor (run nf-spawn's docker run with sudo, or make the task user's docker-group membership effective for the task shell). Flagging because a first-time nf-spawn user hits this wall immediately.
Verified fixed in v0.10.1 — externally, by dropping the workaround rather than reading the changelog. Removed the ext.setup = 'sudo chmod 666 /var/run/docker.sock' mitigation entirely and re-ran the 5-process DAG on 0.10.1: completed=5, failed=0, zero docker: permission denied in any .command.err, all five .exitcode=0. So the executor now reaches the socket on its own. Thanks for the fast turnaround. (Filed #96 separately for the instance-termination behavior at DAG scale, which is unrelated to this and still present.)
Activity
scttfrdmn commentedon Sep 5, 2026
To be explicit about severity and ownership: this is a blocker, not a rough edge — with a
containerdirective underexecutor = 'spawn'on a stock AMI, no pipeline runs out of the box; every process fails exit 126 with a confusing Docker-socket error that doesn't obviously point at nf-spawn. Theext.setupsocket-chmod is a user-side mitigation on the ephemeral instance, not a fix — the fix belongs in the executor (run nf-spawn'sdocker runwith sudo, or make the task user's docker-group membership effective for the task shell). Flagging because a first-time nf-spawn user hits this wall immediately.fix: run nf-spawn's docker run via sudo, fixing exit-126 socket permi…
scttfrdmn commentedon Sep 5, 2026
Verified fixed in v0.10.1 — externally, by dropping the workaround rather than reading the changelog. Removed the
ext.setup = 'sudo chmod 666 /var/run/docker.sock'mitigation entirely and re-ran the 5-process DAG on 0.10.1: completed=5, failed=0, zerodocker: permission deniedin any.command.err, all five.exitcode=0. So the executor now reaches the socket on its own. Thanks for the fast turnaround. (Filed #96 separately for the instance-termination behavior at DAG scale, which is unrelated to this and still present.)