apptainer / singularity

Singularity has been renamed to Apptainer as part of us moving the project to the Linux Foundation. This repo has been persisted as a snapshot right before the changes.
https://github.com/apptainer/apptainer
Other
2.52k stars 424 forks source link

panic: unhandled builtin: umask during build #5545

Closed sjpb closed 4 years ago

sjpb commented 4 years ago

Version of Singularity:

What version of Singularity are you using? Run:

$ singularity version
3.6.2

Expected behavior

Successful container build

Actual behavior

(hpc-tests) [centos@eb-login-0 containers]$ sudo singularity build IMB-2019.3-gompi-2019a.sif Singularity.IMB-2019.3-gompi-2019a
INFO:    Starting build...
INFO:    Running post scriptlet
UID: readonly variable
panic: unhandled builtin: umask

goroutine 1 [running, locked to thread]:
mvdan.cc/sh/v3/interp.(*Runner).builtinCode(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x5003e00000621, 0xc00032f3f4, 0x5, 0xc000349450, 0x1, 0x1, 0x0)
        mvdan.cc/sh/v3@v3.1.2/interp/builtin.go:657 +0x8a35
mvdan.cc/sh/v3/interp.(*Runner).call(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x5003e00000621, 0xc000349440, 0x2, 0x2)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:729 +0x39c
mvdan.cc/sh/v3/interp.(*Runner).cmd(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x55a9fb117280, 0xc000359d70)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:335 +0x16cb
mvdan.cc/sh/v3/interp.(*Runner).stmtSync(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc00035adc0)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:275 +0x314
mvdan.cc/sh/v3/interp.(*Runner).stmt(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc00035adc0)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:256 +0x1eb
mvdan.cc/sh/v3/interp.(*Runner).stmts(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc00025db00, 0x1, 0x4)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:586 +0x58
mvdan.cc/sh/v3/interp.(*Runner).cmd(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x55a9fb1174c0, 0xc000330d20)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:385 +0x6f6
mvdan.cc/sh/v3/interp.(*Runner).cmd(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x55a9fb1174c0, 0xc000330c80)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:390 +0x6ab
mvdan.cc/sh/v3/interp.(*Runner).stmtSync(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc00035ab58)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:275 +0x314
mvdan.cc/sh/v3/interp.(*Runner).stmt(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc00035ab58)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:256 +0x1eb
mvdan.cc/sh/v3/interp.(*Runner).stmts(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc000188800, 0xb, 0x10)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:586 +0x58
mvdan.cc/sh/v3/interp.(*Runner).builtinCode(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x1000600000072, 0xc00032ee40, 0x6, 0xc000348110, 0x1, 0x1, 0x0)
        mvdan.cc/sh/v3@v3.1.2/interp/builtin.go:295 +0xb70
mvdan.cc/sh/v3/interp.(*Runner).call(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x1000600000072, 0xc000348100, 0x2, 0x2)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:729 +0x39c
mvdan.cc/sh/v3/interp.(*Runner).cmd(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x55a9fb117280, 0xc00034d500)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:335 +0x16cb
mvdan.cc/sh/v3/interp.(*Runner).stmtSync(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc00015a800)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:275 +0x314
mvdan.cc/sh/v3/interp.(*Runner).stmt(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc00015a800)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:256 +0x1eb
mvdan.cc/sh/v3/interp.(*Runner).stmts(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc000186600, 0x6, 0x8)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:586 +0x58
mvdan.cc/sh/v3/interp.(*Runner).builtinCode(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x11004e00000885, 0xc00032edb0, 0x6, 0xc000348050, 0x1, 0x1, 0x0)
        mvdan.cc/sh/v3@v3.1.2/interp/builtin.go:295 +0xb70
mvdan.cc/sh/v3/interp.(*Runner).call(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x11004e00000885, 0xc000348040, 0x2, 0x2)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:729 +0x39c
mvdan.cc/sh/v3/interp.(*Runner).cmd(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x55a9fb117280, 0xc0001eb110)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:335 +0x16cb
mvdan.cc/sh/v3/interp.(*Runner).stmtSync(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc000158720)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:275 +0x314
mvdan.cc/sh/v3/interp.(*Runner).stmt(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc000158720)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:256 +0x1eb
mvdan.cc/sh/v3/interp.(*Runner).stmts(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc00025c2e0, 0x2, 0x4)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:586 +0x58
mvdan.cc/sh/v3/interp.(*Runner).cmd(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x55a9fb1172c0, 0xc0000e8960)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:444 +0x8df
mvdan.cc/sh/v3/interp.(*Runner).stmtSync(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc000158568)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:275 +0x314
mvdan.cc/sh/v3/interp.(*Runner).stmt(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc000158568)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:256 +0x1eb
mvdan.cc/sh/v3/interp.(*Runner).stmts(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc00025c260, 0x2, 0x4)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:586 +0x58
mvdan.cc/sh/v3/interp.(*Runner).cmd(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x55a9fb1174c0, 0xc00011f360)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:385 +0x6f6
mvdan.cc/sh/v3/interp.(*Runner).stmtSync(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc000158460)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:275 +0x314
mvdan.cc/sh/v3/interp.(*Runner).stmt(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc000158460)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:256 +0x1eb
mvdan.cc/sh/v3/interp.(*Runner).loopStmtsBroken(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc00025c380, 0x1, 0x4, 0xc000117100)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:686 +0xcf
mvdan.cc/sh/v3/interp.(*Runner).cmd(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x55a9fb117440, 0xc0000e8900)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:415 +0x393
mvdan.cc/sh/v3/interp.(*Runner).stmtSync(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc000158408)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:275 +0x314
mvdan.cc/sh/v3/interp.(*Runner).stmt(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc000158408)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:256 +0x1eb
mvdan.cc/sh/v3/interp.(*Runner).stmts(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc00025c3a0, 0x1, 0x4)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:586 +0x58
mvdan.cc/sh/v3/interp.(*Runner).cmd(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x55a9fb1174c0, 0xc00011f2c0)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:385 +0x6f6
mvdan.cc/sh/v3/interp.(*Runner).stmtSync(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc000158358)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:275 +0x314
mvdan.cc/sh/v3/interp.(*Runner).stmt(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc000158358)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:256 +0x1eb
mvdan.cc/sh/v3/interp.(*Runner).stmts(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0xc000188480, 0xe, 0x10)
        mvdan.cc/sh/v3@v3.1.2/interp/runner.go:586 +0x58
mvdan.cc/sh/v3/interp.(*Runner).Run(0xc000246fc0, 0x55a9fb119900, 0xc0000b4020, 0x55a9fb1112c0, 0xc000186140, 0xc000186140, 0x0)
        mvdan.cc/sh/v3@v3.1.2/interp/api.go:523 +0x172
github.com/sylabs/singularity/internal/pkg/util/shell/interpreter.(*Shell).Run(0xc000186100, 0xc0002483c0, 0x55a9fab79a38)
        github.com/sylabs/singularity@v0.0.0/internal/pkg/util/shell/interpreter/interpreter.go:223 +0x144
github.com/sylabs/singularity/internal/pkg/runtime/engine/singularity.runActionScript(0xc00018a6e0, 0x0, 0x0, 0x0, 0x0, 0x80, 0xc000188280, 0xc000028000, 0x8)
        github.com/sylabs/singularity@v0.0.0/internal/pkg/runtime/engine/singularity/process_linux.go:804 +0x6fb
github.com/sylabs/singularity/internal/pkg/runtime/engine/singularity.(*EngineOperations).StartProcess(0xc000176bf0, 0x55a9fb11f240, 0xc000011150, 0x0, 0x0)
        github.com/sylabs/singularity@v0.0.0/internal/pkg/runtime/engine/singularity/process_linux.go:163 +0x589
github.com/sylabs/singularity/internal/app/starter.StageTwo(0x6, 0xc00000ea60)
        github.com/sylabs/singularity@v0.0.0/internal/app/starter/stage_linux.go:58 +0x15f
main.startup.func1()
        github.com/sylabs/singularity@/cmd/starter/main_linux.go:64 +0x3c
github.com/sylabs/singularity/internal/pkg/util/mainthread.Execute.func1()
        github.com/sylabs/singularity@v0.0.0/internal/pkg/util/mainthread/mainthread.go:21 +0x31
main.main()
        github.com/sylabs/singularity@/cmd/starter/main_linux.go:106 +0x61
FATAL:   While performing build: while running engine: exit status 2

Steps to reproduce this behavior

How can others reproduce this issue/problem? See attached recipe (I added .txt so github would accept it)

Singularity.IMB-2019.3-gompi-2019a.txt

What OS/distro are you running

$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

How did you install Singularity

Write here how you installed Singularity. Eg. RPM, source.

sudo yum -y install go debootstrap squashfs-tools
wget https://github.com/hpcng/singularity/releases/download/v3.6.2/singularity-3.6.2.tar.gz
tar -xf singularity-3.6.2.tar.gz 
cd singularity
./mconfig
make -C builddir
sudo make -C builddir install
cclerget commented 4 years ago

@sjpb When you get a chance could you give a try to #5550 ?

sjpb commented 4 years ago

@cclerget nice! Yes thank you I get a successful build and (using that singularity) I can shell into the container.

Out of interest how come not everyone is hitting this? I.e. what's unusual about my build (ETA: or environment)?

cclerget commented 4 years ago

@sjpb you use localimage to bootstrap the new image, since the localimage already contains environment files (using umask somewhere), the environment was evaluated by the shell interpreter during the execution of the post build section and crashed.