0

概述

我正在运行 Ubuntu 18.04 的机器上处理奇点映像中的代码。截至周二晚上,它在机器A上工作(好吧,我正在调试代码) 。我运行了更新,从第二天开始,任何运行任何奇异容器的尝试都给了我以下错误:

ERROR  : Failed to mount squashfs image in (read only): Invalid argument
ABORT  : Retval = 255

在确认这不是由于我的代码造成的(通过简单地运行singularity exec <my_image_file>.sif并得到相同的错误后,我记得我在另一台机器(B)上有几乎相同的设置。我能够在那里运行图像而没有问题。

不幸的是,我忘记了在那台机器上选择了“无人值守更新”并重新启动。它现在返回相同的错误。

我的尝试

我这里有点空。我所做的只是说服自己它与我的代码没有直接关系,而且几乎可以肯定与更新的东西有关。我对 squashfs 并不太了解,而且对奇点还比较陌生。我没有在网上找到任何有这个确切错误的东西(“无效参数”部分)。作为冰雹玛丽,我在机器A上重新安装了奇异性,但它没有改变。

我不相信这是奇点本身的问题,而且我使用的是旧版本,所以我认为这不是一个有效的 github 问题。我使用的是 2.5.2 版本,因为这是该代码所针对的集群上使用的版本。

细节

-vv 来自奇点的日志(注意:无论我通过什么参数,都提供相同的反馈):

Increasing verbosity level (4)
Singularity version: 2.5.2-dist
Exec'ing: /usr/local/libexec/singularity/cli/exec.exec
Evaluating args: '<my_image_file>.sif <my_program> <program_arg>'
VERBOSE: Set messagelevel to: 4
VERBOSE: Initialize configuration file: /usr/local/etc/singularity/singularity.conf
VERBOSE: Got config key allow setuid = 'yes'
VERBOSE: Got config key max loop devices = '256'
VERBOSE: Got config key allow pid ns = 'yes'
VERBOSE: Got config key config passwd = 'yes'
VERBOSE: Got config key config group = 'yes'
VERBOSE: Got config key config resolv_conf = 'yes'
VERBOSE: Got config key mount proc = 'yes'
VERBOSE: Got config key mount sys = 'yes'
VERBOSE: Got config key mount dev = 'yes'
VERBOSE: Got config key mount devpts = 'yes'
VERBOSE: Got config key mount home = 'yes'
VERBOSE: Got config key mount tmp = 'yes'
VERBOSE: Got config key mount hostfs = 'no'
VERBOSE: Got config key bind path = '/etc/localtime'
VERBOSE: Got config key bind path = '/etc/hosts'
VERBOSE: Got config key user bind control = 'yes'
VERBOSE: Got config key enable overlay = 'try'
VERBOSE: Got config key mount slave = 'yes'
VERBOSE: Got config key sessiondir max size = '16'
VERBOSE: Got config key allow container squashfs = 'yes'
VERBOSE: Got config key allow container extfs = 'yes'
VERBOSE: Got config key allow container dir = 'yes'
VERBOSE: Initializing Singularity Registry
VERBOSE: Adding value to registry: 'COMMAND' = 'exec'
VERBOSE: Adding value to registry: 'SYSCONFDIR' = '/usr/local/etc'
VERBOSE: Adding value to registry: 'VERSION' = '2.5.2-dist'
VERBOSE: Adding value to registry: 'IMAGE' = '<my_image_file>.sif'
VERBOSE: Adding value to registry: 'MESSAGELEVEL' = '4'
VERBOSE: Adding value to registry: 'BINDIR' = '/usr/local/bin'
VERBOSE: Adding value to registry: 'LOCALSTATEDIR' = '/usr/local/var'
VERBOSE: Adding value to registry: 'LIBEXECDIR' = '/usr/local/libexec'
VERBOSE: Set home (via getpwuid()) to: <my_home_directory>
VERBOSE: Running SUID program workflow
VERBOSE: Checking program has appropriate permissions
VERBOSE: Checking configuration file is properly owned by root
VERBOSE: Checking if singularity.conf allows us to run as suid
VERBOSE: Invoking the user namespace
VERBOSE: Not virtualizing USER namespace: running as SUID
VERBOSE: No autofs bug path in configuration, skipping
VERBOSE: Instantiating read only container image object
VERBOSE: Checking that file pointer is a Singularity image
VERBOSE: File is a valid SquashFS image
VERBOSE: Adding value to registry: 'CLEANUPD_FD' = '-1'
VERBOSE: Not virtualizing IPC namespace on user request
VERBOSE: Not virtualizing PID namespace on user request
VERBOSE: Not virtualizing network namespace on user request
VERBOSE: Using session directory: /usr/local/var/singularity/mnt/session
VERBOSE: Adding value to registry: 'SESSIONDIR' = '/usr/local/var/singularity/mnt/session'
VERBOSE: Found available loop device: /dev/loop18
VERBOSE: Using loop device: /dev/loop18
VERBOSE: Mounting squashfs image: /dev/loop18 -> /usr/local/var/singularity/mnt/container
ERROR  : Failed to mount squashfs image in (read only): Invalid argument
ABORT  : Retval = 255

dpkg.log 中“升级”的 grep:

2020-07-23 06:10:36 upgrade evolution-data-server-common:all 3.28.5-0ubuntu0.18.04.2 3.28.5-0ubuntu0.18.04.3
2020-07-23 06:10:41 upgrade linux-libc-dev:amd64 4.15.0-111.112 4.15.0-112.113
2020-07-23 06:10:46 upgrade python-pil:amd64 5.1.0-1ubuntu0.2 5.1.0-1ubuntu0.3
2020-07-23 06:10:51 upgrade python3-pil:amd64 5.1.0-1ubuntu0.2 5.1.0-1ubuntu0.3
2020-07-23 06:10:56 upgrade python2.7:amd64 2.7.17-1~18.04ubuntu1 2.7.17-1~18.04ubuntu1.1
2020-07-23 06:10:57 upgrade libpython2.7:amd64 2.7.17-1~18.04ubuntu1 2.7.17-1~18.04ubuntu1.1
2020-07-23 06:10:57 upgrade libpython2.7-stdlib:amd64 2.7.17-1~18.04ubuntu1 2.7.17-1~18.04ubuntu1.1
2020-07-23 06:10:58 upgrade python2.7-minimal:amd64 2.7.17-1~18.04ubuntu1 2.7.17-1~18.04ubuntu1.1
2020-07-23 06:10:58 upgrade libpython2.7-minimal:amd64 2.7.17-1~18.04ubuntu1 2.7.17-1~18.04ubuntu1.1
2020-07-23 06:11:06 upgrade python3.6-venv:amd64 3.6.9-1~18.04ubuntu1 3.6.9-1~18.04ubuntu1.1
2020-07-23 06:11:06 upgrade python3.6-dev:amd64 3.6.9-1~18.04ubuntu1 3.6.9-1~18.04ubuntu1.1
2020-07-23 06:11:06 upgrade libpython3.6-dev:amd64 3.6.9-1~18.04ubuntu1 3.6.9-1~18.04ubuntu1.1
2020-07-23 06:11:11 upgrade libpython3.6:amd64 3.6.9-1~18.04ubuntu1 3.6.9-1~18.04ubuntu1.1
2020-07-23 06:11:11 upgrade python3.6:amd64 3.6.9-1~18.04ubuntu1 3.6.9-1~18.04ubuntu1.1
2020-07-23 06:11:11 upgrade libpython3.6-stdlib:amd64 3.6.9-1~18.04ubuntu1 3.6.9-1~18.04ubuntu1.1
2020-07-23 06:11:12 upgrade python3.6-minimal:amd64 3.6.9-1~18.04ubuntu1 3.6.9-1~18.04ubuntu1.1
2020-07-23 06:11:12 upgrade libpython3.6-minimal:amd64 3.6.9-1~18.04ubuntu1 3.6.9-1~18.04ubuntu1.1
2020-07-23 06:11:29 upgrade linux-generic-hwe-18.04:amd64 5.3.0.62.115 5.4.0.42.46~18.04.35
2020-07-23 06:11:29 upgrade linux-image-generic-hwe-18.04:amd64 5.3.0.62.115 5.4.0.42.46~18.04.35
2020-07-23 06:11:41 upgrade linux-headers-generic-hwe-18.04:amd64 5.3.0.62.115 5.4.0.42.46~18.04.35
2020-07-23 06:12:37 upgrade evolution-data-server:amd64 3.28.5-0ubuntu0.18.04.2 3.28.5-0ubuntu0.18.04.3
2020-07-23 06:12:37 upgrade libebook-1.2-19:amd64 3.28.5-0ubuntu0.18.04.2 3.28.5-0ubuntu0.18.04.3
2020-07-23 06:12:38 upgrade libedata-book-1.2-25:amd64 3.28.5-0ubuntu0.18.04.2 3.28.5-0ubuntu0.18.04.3
2020-07-23 06:12:38 upgrade libedata-cal-1.2-28:amd64 3.28.5-0ubuntu0.18.04.2 3.28.5-0ubuntu0.18.04.3
2020-07-23 06:12:38 upgrade libebook-contacts-1.2-2:amd64 3.28.5-0ubuntu0.18.04.2 3.28.5-0ubuntu0.18.04.3
2020-07-23 06:12:38 upgrade libebackend-1.2-10:amd64 3.28.5-0ubuntu0.18.04.2 3.28.5-0ubuntu0.18.04.3
2020-07-23 06:12:38 upgrade libecal-1.2-19:amd64 3.28.5-0ubuntu0.18.04.2 3.28.5-0ubuntu0.18.04.3
2020-07-23 06:12:38 upgrade libedataserver-1.2-23:amd64 3.28.5-0ubuntu0.18.04.2 3.28.5-0ubuntu0.18.04.3
2020-07-23 06:12:39 upgrade libcamel-1.2-61:amd64 3.28.5-0ubuntu0.18.04.2 3.28.5-0ubuntu0.18.04.3
2020-07-23 06:12:44 upgrade libavformat-dev:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2
2020-07-23 06:12:44 upgrade libavcodec-dev:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2
2020-07-23 06:12:45 upgrade libswresample-dev:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2
2020-07-23 06:12:45 upgrade libswresample2:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2
2020-07-23 06:12:45 upgrade libswscale-dev:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2
2020-07-23 06:12:45 upgrade libswscale4:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2
2020-07-23 06:12:46 upgrade libavresample-dev:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2
2020-07-23 06:12:46 upgrade libavresample3:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2
2020-07-23 06:12:46 upgrade libavutil-dev:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2
2020-07-23 06:12:46 upgrade libavutil55:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2
2020-07-23 06:12:46 upgrade libavcodec57:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2
2020-07-23 06:12:47 upgrade libavformat57:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2
2020-07-23 06:12:52 upgrade libpostproc54:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2
2020-07-23 06:12:57 upgrade libavfilter6:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2
2020-07-23 06:13:02 upgrade libavdevice57:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2
2020-07-23 06:13:06 upgrade ffmpeg:amd64 7:3.4.6-0ubuntu0.18.04.1 7:3.4.8-0ubuntu0.2

该映像是从 Docker 映像构建的,需要几个额外的步骤。我没有提供任何信息,因为这种行为似乎并不取决于我何时构建图像。

4

2 回答 2

2

我遇到了这个确切的问题,我设法在 Ubuntu 18.04 中用奇异版本 2.6.1 修复了它(我认为在 2.5.2 中解决方案对你来说不会有太大不同)。

采取的步骤

  1. 如果需要,卸载早期版本的 Singularity。

  2. 打开终端并运行以下命令,下载正确 Singularity 版本的压缩包:

# Go to the place you want to work in
cd ~
VERSION=2.6.1  # Set an environment variable just for convenience, could replace with another version.
# Download
wget https://github.com/singularityware/singularity/releases/download/$VERSION/singularity-$VERSION.tar.gz
# Extract
tar xvf singularity-$VERSION.tar.gz
  1. 现在,应该有一个名为的文件夹singularity-2.6.1(对我来说它放在 Home ( ~) 中。然后打开mount.c放置在其中的文件singularity-2.6.1/src/lib/image/squashfs/mount.c(我不确定这是否与 v2.5.2 相同,但我认为没有太大变化。我们可能不过运气不好)

  2. 在这个文件中找到代码行

if ( singularity_mount(loop_dev, mount_point, "squashfs", MS_NOSUID|MS_RDONLY|MS_NODEV, "errors=remount-ro") < 0 )

将其更改为

if ( singularity_mount(loop_dev, mount_point, "squashfs", MS_NOSUID|MS_RDONLY|MS_NODEV, "") < 0 )

不要忘记保存!

  1. 通过运行命令返回到终端以从编辑的安装文件中安装 Singularity
cd singularity-$VERSION
./configure --prefix=/usr/local
make
sudo make install

对我来说,问题现在已经解决了!

编辑

正如aguadopd所指出的,make如果您没有安装,该命令可能不起作用libarchive-dev。如果是这种情况,那么首先通过在终端中运行来修复它

sudo apt-get update -y
sudo apt-get install -y libarchive-dev

然后在一个新的终端

singularity shell -p $HOME/Downloads/hrwros-09.simg

问题原因

显然,曾经有一个错误,squashfs如果它不知道,它会简单地忽略参数。当这个问题在今年早些时候得到修复时,它在遇到无效参数时开始出错,就像我们的例子一样。(也在这里解释https://www.mail-archive.com/debian-kernel@lists.debian.org/msg117435.html)因此,删除未知参数"errors=remount-ro"解决了问题。

因为老实说,我对此 100% 陌生,所以我不确定它是否会在其他地方引发任何新错误。然而,这也是这个错误在后来的 Singularity 版本中基本修复的方式(https://github.com/hpcng/singularity/pull/4802/files/3f3136be150d9a8f63e58a0b4e39dc8487f1c0dc)。

希望它有所帮助!

于 2020-08-05T10:17:04.817 回答
0

谢谢。我按照你的步骤,它工作。但是,我在“制作”步骤时遇到了问题。它不起作用,因为我没有安装“libarchive-dev”。为了解决它,我做了

  1. sudo apt-get update -y
  2. sudo apt-get install -y libarchive-dev

然后在一个新的终端

  1. 奇点外壳 -p $HOME/Downloads/hrwros-09.simg

现在它正在工作。

于 2020-12-04T06:03:45.753 回答