Repository navigation
Description
Summary
On the spawn task run container path, staged directories are created as the
instance user but docker run is issued with no --user, so a container whose
image USER is neither root nor uid 1000 cannot write into any of them. Every
bioconda-derived image is in that category: they run as mambauser, uid
57439. A task whose command writes its output next to its input gets EACCES,
and because the wrapper deliberately doesn't set -e, that surfaces as a
stage-out failure rather than as "your container couldn't write".
Evidence
pkg/taskproto/wrapper.go:87 — stage-in creates each destination's parent
directory as whoever runs the wrapper (the instance user, uid 1000 on AL2023),
with the default umask, so 0755:
p("mkdir -p %s\n", shQuote(dir))pkg/taskproto/wrapper.go:233 — the container is then started with those
directories bind-mounted identity-mapped, and no --user:
p(" sudo docker run --rm %s%s%s %s\n", gpuFlag, mounts.String(), shQuote(image), quoteArgv(spec.Command))pkg/taskproto/wrapper.go:241 containerMountDirs confirms the mounted set is
exactly path.Dir() of each input destination and each output source — i.e. the
directories a task naturally writes into are precisely the ones it can't.
The image side, verified against the live registry (quay.io/aarchbio/bwa,
digest sha256:19f0eceab80740b821be7ada082d4434acf778912aac658dd1b4c6692dd2e9ba):
$ docker run --rm quay.io/aarchbio/bwa@sha256:19f0ece... bash -c id
uid=57439(mambauser) gid=57439(mambauser) groups=57439(mambauser)
57439 is the mambaorg/micromamba default, so this applies to the whole
bioconda/conda-forge container ecosystem, not one image.
What I verified and what I didn't
Verified: the uid is 57439; the wrapper creates the dirs as the instance user;
no --user is passed. Not verified: the EACCES itself on a real instance.
I tried to reproduce locally, but Docker Desktop for macOS remaps bind-mount
ownership through its filesystem layer (the mount shows as root:root and the
write succeeds), so a mac repro proves nothing about Linux. On native Linux the
bind mount preserves host uid/gid, and uid 57439 writing into a 0755 directory
owned by uid 1000 must fail — but I'd rather flag that as inference than claim a
run I didn't do.
Suggested fix
Passing the invoking user through is the one-liner, and matches the intent that
the container is a packaging detail rather than a different security context:
p(" sudo docker run --rm --user \"$(id -u):$(id -g)\" %s%s%s %s\n", ...)That has a cost: it breaks images that need their own USER (anything writing
into $HOME or a conda prefix at runtime). If that's too blunt, chmod 0777 on
the directories mkdir -p creates is uglier but has no such side effect — they
are throwaway staging dirs on a single-tenant ephemeral instance.
Workaround, for the docs either way
Put every input destination and output source directly in /tmp, which is 1777
on the host, so the single resulting bind mount is writable regardless of the
image's user. That's what I ended up doing, and it works — but it's a
non-obvious thing to have to discover from the generated wrapper, and the
natural /data + /work layout in examples/task-spec.json is exactly the
layout that fails.
Activity
scttfrdmn commentedon Sep 2, 2026
Confirmed on a real instance: the inference held
I filed this with the uid measured but the
EACCESitself unverified, becauseDocker Desktop on macOS remaps bind-mount ownership and a mac repro proves
nothing. Ran a deliberate probe task on a
c8g.largein us-east-1 to settle it.It held exactly:
Task
cookbook-uidprobe-r2, imagequay.io/aarchbio/bwa@sha256:19f0ece…,declared inputs at
/tmp/pw/in/probe.txtand/tmp/probe_tmp.txt. So: a stageddirectory created by the wrapper is owned
1000:1000mode0755, the containeris uid
57439, and the write fails. The/tmpcontrol in the same run succeeded,which confirms the flat-
/tmpworkaround is load-bearing and not superstition.Two things the probe added that the original report missed
1. Output-source directories are worse: they end up owned by root. The
mkdir -patpkg/taskproto/wrapper.go:87iteratesspec.Inputsonly —— so the parent of each output
sourceis never created on the host. Dockerthen auto-creates it for the bind mount, as root:
/tmp/pw/outabove is0:0, not1000:1000. That matters for the fix, because the--user "$(id -u)"suggestion in my original report would make input dirs writable and still leave
output dirs unwritable. Whatever the fix, it has to create output-source parents
too.
2. Any destination outside
/tmpfails atmkdir, before uid is evenrelevant.
pkg/launcher/bootstrap.go:603runs the wrapper unprivileged:so
mkdir -p /work/incannot create/workat the filesystem root. From theconsole output of a first probe that used
/work:This means the
/data+/workdestination layout inexamples/task-spec.jsoncannot work at all on the task path — not "works but unwritable", but fails at
stage-in. Worth fixing the example either way.
The failure signalling around both of these is bad enough to be its own report;
filing separately.
fix(taskproto): run task containers as the invoking uid:gid (#555)
fix(taskproto): run task containers as the invoking uid:gid (#555) (#557
fix(taskproto): create output-only mount dirs and fix staged-input ow…
fix(taskproto): create output-only mount dirs and fix staged-input ow…
feat: internal/spore.Task — the spawn task run adapter (#103) (#105)
fix(taskproto): create bind-mount dirs with privilege (#564), and doc…