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
No loop devices available for multiple singularity shells in specific kernel #1499
Comments
I am having exactly the same error with |
This seems to be related to apptainer/apptainer#1258 The proposed workaround there is:
|
This has clearly been localized to the Ubuntu 20.04 linux-generic kernel updates corresponding to https://ubuntu.com/security/notices/USN-5982-1 However, it isn't clear to me how the updates listed there would be relevant to loop device calls. It's not trivial to see if other code that may be relevant, but not security-related, was modified, so this will take some time to investigate further. If you observe the issue on any distribution other than Ubuntu 20.04, please give detail of the kernel version, distro version etc. Thank you. |
Confirmed on a VM running This appears to be related to a non-security related patch brought in for this update:
It appears that the patch means that the kernel now sets
Solution On this kernel, you will need to configure You must do this with a kernel CMDLINE entry, because
After this, Singularity should work as normal. |
It appears the issue can probably be avoided by using It still seems to be a bug, however, as the commented code still states:
https://lore.kernel.org/lkml/20221208200605.756287-1-isaacmanjarres@google.com/T/ |
This indeed makes kernel version 5.15.0.69-generic work as expected again (on my end as well). Thanks! If there is anything you need from my side to help solve the root of the issue, let me know! |
Author of apptainer/apptainer#1258 here. This "solution" worked for a very brief time. |
Setting |
Perform loop device creation via the LOOP_CTL_ADD ioctl against /dev/loop-control. This avoids hitting an error in the latest kernels that include a change in handling of loop device creation when max_loop is unset. Our target distros now all provide /dev/loop-control, so we are free to make this change. Also contains minor fixes to correct an error/debug message, and add an earlier continue in case of failure to open loop device in attachLoop. Fixes sylabs#1499
Perform loop device creation via the LOOP_CTL_ADD ioctl against /dev/loop-control. This avoids hitting an error in the latest kernels that include a change in handling of loop device creation when max_loop is unset. Our target distros now all provide /dev/loop-control, so we are free to make this change. Also contains minor fixes to correct an error/debug message, and add an earlier continue in case of failure to open loop device in attachLoop. Fixes sylabs#1499
Perform loop device creation via the LOOP_CTL_ADD ioctl against /dev/loop-control. This avoids hitting an error in the latest kernels that include a change in handling of loop device creation when max_loop is unset. Our target distros now all provide /dev/loop-control, so we are free to make this change. Also contains minor fixes to correct an error/debug message, and add an earlier continue in case of failure to open loop device in attachLoop. Fixes sylabs#1499
Perform loop device creation via the LOOP_CTL_ADD ioctl against /dev/loop-control. This avoids hitting an error in the latest kernels that include a change in handling of loop device creation when max_loop is unset. Our target distros now all provide /dev/loop-control, so we are free to make this change. Also contains minor fixes to correct an error/debug message, and add an earlier continue in case of failure to open loop device in attachLoop. Fixes sylabs#1499
Perform loop device creation via the LOOP_CTL_ADD ioctl against /dev/loop-control. This avoids hitting an error in the latest kernels that include a change in handling of loop device creation when max_loop is unset. Our target distros now all provide /dev/loop-control, so we are free to make this change. Also contains minor fixes to correct an error/debug message, and add an earlier continue in case of failure to open loop device in attachLoop. Fixes sylabs#1499
The issue was raised with Ubuntu by others here: https://bugs.launchpad.net/ubuntu/+source/linux-hwe-5.15/+bug/2013086 |
Just in case somebody else stumbles upon this, this solution is working on Updating Singularity to 3.11.x does not fix the issue, only the above solution works. |
Version of Singularity
3.10.5-focal
Describe the bug
Since a few days I have issues running a second (or more) singularity shells. The first launches as it always did before, from the second one and onwards I get the following error message:
After a lot of searching online I somehow found the workaround by running
$ sudo losetup -f
in a new terminal, to somehow find a loop device which as to my knowledge was already free. After running this command I can run a new parallel singularity shell, but only in this particular terminal. Trying to launch another requires the losetup command to be ran as well.After some more searching I noticed it was dependent on my kernel version:
5.15.0-69-generic
. Rolling back to5.15.0-46-generic
while booting fixes the issue completely.To Reproduce
I've tried many singularity container files, it does not seem to matter as far as I know. Simply be running either singularity
3.10.2
or3.10.5
(maybe other versions as well) on kernel version5.15.0-69-generic
and launching with$ singularity shell -p <any .sif/.simg>
will create the error message above.Expected behavior
Expected is for the command
$ singularity shell -p <any .sif/.simg>
to have no issues with multiple terminals running more singularity shells.OS / Linux Distribution
(I also had the issue on a 22.04 partition, but already removed the partition in the meantime...)
Installation Method
I installed Singularity from here or here using the focal and jammy .deb downloads, and running dpkg to install followed by a
$ sudo apt install -f
.Additional context
This issue seems to be kernel-version dependent. Probably more other kernel versions will solve this issue. For me the kernel version that causes this issue is
5.15.0-69-generic
. Peers working with similar setups using5.15.0-67-generic
seem to be not having this issue already, so downgrading all the way to5.15.0-46-generic
seems not necessary but was the only one I specifically still had installed.The text was updated successfully, but these errors were encountered: