Environment Overlay Issues
A writable overlay (env.img) is one file that holds a small filesystem. When a container opens it for writing, a program called fuse2fs lets an ordinary user read and write that file without administrator rights.
Not shut down cleanly
Section titled “Not shut down cleanly”env.img was not shut down cleanly. Run `condatainer overlay fscheck env.img` to check it.A container stopped before it released the overlay, for example when a job reached its time limit and was killed. The overlay still opens, and nothing is changed.
Check and repair it when no container is using it:
condatainer overlay fscheck env.imgAdd -f to check an overlay that is marked clean.
In use by another process
Section titled “In use by another process”env.img is currently in useenv.img is open for writing by another processA writable overlay can be open in only one container at a time, and it cannot be opened for writing while read-only containers use it. Wait for the other container to exit, or stop it. See Writable vs. Read-Only Modes.
Find what holds it
Section titled “Find what holds it”On this machine, list the processes that have the file open:
lsof env.imglsof shows only this machine. On a cluster, a job on another node can hold the overlay. List your jobs with the scheduler’s own command and cancel the one that uses it:
squeue -u $USER # Slurmscancel <job_id>A job you started with condatainer helper run is stopped with condatainer helper stop.
After a job is killed while it wrote to the overlay, check it before the next use.
Write-protected
Section titled “Write-protected”env.img is write-protected; chmod u+w to allow changesenv.img is not writable by you (owner: alice)- CondaTainer never changes an overlay that you cannot write.
- Write access removed from your own file protects it on purpose. Restore it with
chmod u+w env.imgto change the overlay. - Another user’s file is theirs to change. Copy it, chown and use your copy.
Read-only file system
Section titled “Read-only file system”Read-only file systemInside the container, a write failed because the overlay is mounted read-only. exec and run mount an .img read-only unless you add -w. Leave the container and open it for writing:
condatainer e env.img # Writable by defaultcondatainer exec -w -o env.img bashNo space left on device
Section titled “No space left on device”No space left on deviceThe overlay is full. Leave the container, then check the disk and inode usage and grow the overlay:
condatainer info env.imgcondatainer overlay resize env.img -s 30GTo free space first, run mm clean -a inside the container. It removes Conda’s cached index, tarballs and unused packages.
Permission denied inside the container
Section titled “Permission denied inside the container”Files in the overlay that belong to another user ID cannot be changed by you. Change their owner without mounting:
condatainer overlay chown env.img # Everything owned by youcondatainer overlay chown env.img --root # Owned by root, for --fakerootSee Fix Ownership.
Cannot mount for writing
Section titled “Cannot mount for writing”cannot mount env.img for writing: fuse2fs 1.47.1 (/usr/bin/fuse2fs) has a bug that silently corrupts a file overwritten with shorter content. Run `condatainer update --libexec apptainer` to install a fixed version.On a login node, outside any container:
condatainer update --libexec apptainerWhy it is refused
Section titled “Why it is refused”- A
fuse2fsolder than 1.47.3 that is built on libfuse 3 does not shorten a file that is overwritten with less content. The new content is followed by leftover bytes of the old. (O_TRUNC) - A shell redirection (
cat small > file),cpover an existing file, and installing an R package over an older version all do this. - Some operating systems ship an affected
fuse2fs.