Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

container creation failed: no loop device available #1669

Closed
sparktx-chao-di opened this issue May 10, 2023 · 4 comments
Closed

container creation failed: no loop device available #1669

sparktx-chao-di opened this issue May 10, 2023 · 4 comments

Comments

@sparktx-chao-di
Copy link

I've been testing the nf-core/rnaseq pipeline on my EC2 instance without issue, but recently after an instance reboot the same pipeline failed with error message " FATAL: container creation failed: mount /proc/self/fd/3->/usr/local/var/singularity/mnt/session/rootfs error: while mounting image /proc/self/fd/3: failed to find loop device: could not attach image file to loop device: no loop devices available".

I've searched around and asked for help internally. Here are some info that may be helpful:

  • When I reboot the EC2 instance, I can see there are 14 loop devices available by ls /dev/loop*, but when I run the Nextflow pipeline, somehow, it automatically generates more loop devices and the total number became 256 when I do ls /dev/loop*, and the newly generated loop devices all have the permission of "brw-r----- 1" other than the preexisting ones with "brw-rw---- 1". So it seems I don't have the write permission for these loop devices as a non-root user. I wonder if there is any configuration in Singularity that can change these?

  • I ran with the same error when I ran Snakemake pipelines with Singularity for some rules, so the issue is not from Nextflow itself. The command is like "snakemake -s Snakefile.py --use-singularity --singularity-args "-B /mnt/bfx-ops/:/mnt/bfx-ops/". One thing strange is that every time I ran the command one job is actually running with the container with the expected output, but all the other jobs running in parallel failed with the same FATAL error.

  • My system is "Linux ip-10-50-11-146 5.15.0-1035-aws build(deps): bump github.com/fatih/color from 1.10.0 to 1.11.0 #39~20.04.1-Ubuntu SMP Wed Apr 19 15:34:33 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux". My EC2 instance has 64 cores. Our system admin claimed there were no changes or updates on the EC2 instance,

  • The command I'm running is"
    nextflow run nf-core/rnaseq --input samplesheet_local.csv --outdir output --gtf genes.gtf --fasta genome.fa -profile singularity
    "

-My Singularity has been working well on its own. I can run the following with no issues.
$ singularity pull --name hello.simg shub://vsoch/hello-world
$ singularity run hello.simg

Thank you for your help!

@sparktx-chao-di
Copy link
Author

Sorry to mention that my Singularity version is v3.11.0

@sparktx-chao-di
Copy link
Author

If I do "singularity shell hello.simg", I was able to get the container running or say get into the container. But if I open a new shell terminal and do "singularity shell hello.simg" again, I would get the same error "FATAL: container creation failed: mount /proc/self/fd/3->/usr/local/var/singularity/mnt/session/rootfs error: while mounting image /proc/self/fd/3: failed to find loop device: could not attach image file to loop device: no loop devices available".
So I guess there is something wrong with my system config that doesn't allow me to run multiple Singularity containers in parallel, although my EC2 instance has 64 cores available.

@dtrudg
Copy link
Member

dtrudg commented May 11, 2023

A recent change in the Ubuntu kernel affected loop device creation with the method previously employed by SingularityCE.

A workaround was implemented in SIngularityCE v3.11.2.

If you upgrade to a newer version, things should work as expected.

References:

@dtrudg dtrudg closed this as completed May 11, 2023
@sparktx-chao-di
Copy link
Author

Thanks a lot! That solves my problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants