singularity
singularity copied to clipboard
Unprevilged proot builds error
Note: We encourage questions about usage of SingularityCE to be made via the Google Group or Slack channels. Other users frequent these communities, and may already have the answer to your question!
See: https://sylabs.io/singularity#community for links.
Type of issue New feature in singularity 3.11.0
Description of issue Give a concise, but complete description of the issue here, with any information that might be needed to investigate, or act on it.
Hi, I attempted to build a singularity container with a definition file using unprevilged proot 5.2.0 on singularity 3.11.0, but I received an error when trying to install a package using apt package manager in the $post section. If I run conda to install a package in the $post section, the build was successful. According to an error log, I suspect it doesn't have permission to run package manager. On this issue, I ask for assistance.
1138% [wjnadia@glogin02 singularity_guide]$ singularity build ubuntu.sif ubuntu.def
INFO: Using proot to build unprivileged. Not all builds are supported. If build fails, use --remote or --fakeroot.
INFO: Starting build...
2023/03/09 11:55:51 info unpack layer: sha256:58289280d3c7925e901df9362a9787a557d2fdee0680e1e4251f9ae50b36cf30
INFO: Running post scriptlet
+ apt-get update
Reading package lists... Done
E: Method gave invalid 400 URI Failure message: Could not switch saved set-user-ID
E: Method gave invalid 400 URI Failure message: Could not switch saved set-user-ID
E: Method http has died unexpectedly!
E: Sub-process http returned an error code (112)
FATAL: While performing build: while running engine: exit status 100
1139% [wjnadia@glogin02 singularity_guide]$ cat ubuntu.def
Bootstrap: docker
From: ubuntu:18.04
%post
apt-get update
apt-get install -y wget git bash gcc gfortran g++ make file
%runscript
echo "hello world from ubuntu container!"
Hi @wjnadia - Running singularity build ubuntu.def
on Fedora with proot 5.3.1 I don't see the issue you have - in my case, the apt-get update
completes successfully.
You might want to try adding -o APT::Sandbox::User=root
to the apt-get
lines, e.g....
apt-get -o APT::Sandbox::User=root update
If this works, let me know and we'll put it in the documentation.
apt-get update command was successfully run by including "-o APT::Sandbox::User=root" option ,but apt-get install command was failed by group add error while writing changes to /etc/group for setting openssh-client as shown below;
520% [wjnadia@gdebug02 singularity_guide]$ cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
521% [wjnadia@gdebug02 singularity_guide]$ uname -a
Linux gdebug02 3.10.0-1160.49.1.el7.x86_64 #1 SMP Tue Nov 30 15:51:32 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
519% [wjnadia@gdebug02 singularity_guide]$ cat ubuntu.def
Bootstrap: docker
From: ubuntu:18.04
%post
apt-get update -o APT::Sandbox::User=root
apt-get install -o APT::Sandbox::User=root -y wget git bash gcc gfortran g++ make file
%runscript
echo "hello world from ubuntu container!"
59% [wjnadia@gdebug02 singularity_guide]$ singularity build ubuntu.sif ubuntu.def
INFO: Using proot to build unprivileged. Not all builds are supported. If build fails, use --remote or --fakeroot.
Build target 'ubuntu.sif' already exists and will be deleted during the build process. Do you want to continue? [N/y] y
INFO: Starting build...
2023/03/14 18:39:30 info unpack layer: sha256:76769433fd8a87dd77a6ce33db12156b1ea8dad3da3a95e7c9c36a47ec17b24c
INFO: Running post scriptlet
+ apt-get update -o APT::Sandbox::User=root
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:3 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [5557 B]
Get:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:5 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [865 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [107 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
Get:9 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [823 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
Get:11 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [891 kB]
Get:12 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1195 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [10.9 kB]
Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [880 kB]
Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1131 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [22.4 kB]
Get:18 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [49.0 kB]
Fetched 26.2 MB in 8s (3165 kB/s)
Reading package lists... Done
+ apt-get install -o APT::Sandbox::User=root -y wget git bash gcc gfortran g++ make file
[---------]
Setting up libxau6:amd64 (1:1.0.9-1build5) ... Setting up libcbor0.8:amd64 (0.8.0-2ubuntu1) ... Setting up libx11-data (2:1.7.5-1) ... Setting up libmd0:amd64 (1.0.4-1build1) ... Setting up libfido2-1:amd64 (1.10.0-1) ... Setting up libbsd0:amd64 (0.11.5-1) ... Setting up libxdmcp6:amd64 (1:1.1.3-0ubuntu5) ... Setting up libxcb1:amd64 (1.14-3ubuntu3) ... Setting up libedit2:amd64 (3.1-20210910-1build1) ... Setting up libx11-6:amd64 (2:1.7.5-1) ... Setting up libxmuu1:amd64 (2:1.1.3-3) ... _Setting up openssh-client (1:8.9p1-3ubuntu0.1) ... groupadd: failure while writing changes to /etc/group addgroup: `/sbin/groupadd -g 101 ssh' returned error code 10. Exiting. dpkg: error processing package openssh-client (--configure): installed openssh-client package post-installation script subprocess returned error exit status 1 Setting up libxext6:amd64 (2:1.3.4-1build1) ... Setting up xauth (1:1.1-1build2) ... Processing triggers for libc-bin (2.35-0ubuntu3.1) ... Errors were encountered while processing: openssh-client E: Sub-process /usr/bin/dpkg returned an error code (1) FATAL: While performing build: while running engine: exit status 100