toolbox icon indicating copy to clipboard operation
toolbox copied to clipboard

"failed to initialize container" with a minimal set of environment variables

Open swick opened this issue 3 years ago • 1 comments

Describe the bug "failed to initialize container" with a minimal set of environment variables

Steps how to reproduce the behaviour

[swick@sebastian-pc ~]$ env -i HOME=$HOME USER=$USER PATH=/usr/bin:/bin toolbox run -v --container jhbuild jhbuild --help
DEBU Running as real user ID 1000                 
DEBU Resolved absolute path to the executable as /usr/bin/toolbox 
DEBU Running on a cgroups v2 host                 
DEBU Checking if /etc/subgid and /etc/subuid have entries for user swick 
DEBU Validating sub-ID file /etc/subuid           
DEBU Validating sub-ID file /etc/subgid           
DEBU TOOLBOX_PATH is /usr/bin/toolbox             
DEBU Migrating to newer Podman                    
DEBU Toolbox config directory is /home/swick/.config/toolbox 
DEBU Current Podman version is 3.4.4              
DEBU Creating runtime directory toolbox           
DEBU Old Podman version is 3.4.4                  
DEBU Migration not needed: Podman version 3.4.4 is unchanged 
DEBU Setting up configuration                     
DEBU Setting up configuration: file /home/swick/.config/containers/toolbox.conf not found 
DEBU Resolving image name                         
DEBU Distribution (CLI): ''                       
DEBU Image (CLI): ''                              
DEBU Release (CLI): ''                            
DEBU Resolved image name                          
DEBU Image: 'fedora-toolbox:35'                   
DEBU Release: '35'                                
DEBU Resolving container name                     
DEBU Container: ''                                
DEBU Image: 'fedora-toolbox:35'                   
DEBU Release: '35'                                
DEBU Resolved container name                      
DEBU Container: 'fedora-toolbox-35'               
DEBU Resolving image name                         
DEBU Distribution (CLI): ''                       
DEBU Image (CLI): ''                              
DEBU Release (CLI): ''                            
DEBU Resolved image name                          
DEBU Image: 'fedora-toolbox:35'                   
DEBU Release: '35'                                
DEBU Resolving container name                     
DEBU Container: 'jhbuild'                         
DEBU Image: 'fedora-toolbox:35'                   
DEBU Release: '35'                                
DEBU Resolved container name                      
DEBU Container: 'jhbuild'                         
DEBU Checking if container jhbuild exists         
DEBU Inspecting mounts of container jhbuild       
DEBU Starting container jhbuild                   
DEBU Inspecting entry point of container jhbuild  
DEBU Entry point PID is a float64                 
DEBU Entry point of container jhbuild is toolbox (PID=8983) 
DEBU Waiting for container jhbuild to finish initializing 
DEBU Creating runtime directory toolbox           
DEBU Checking if initialization stamp toolbox/container-initialized-8983 exists 
Error: failed to initialize container jhbuild

Expected behaviour Toolbox should be able to run the command.

Actual behaviour Toolbox is not able to run the command.

Output of toolbox --version (v0.0.90+) toolbox version 0.0.99.3

Toolbox package info (rpm -q toolbox) toolbox-0.0.99.3-2.fc35.x86_64

Output of podman version

Version:      3.4.4
API Version:  3.4.4
Go Version:   go1.16.8
Built:        Wed Dec  8 22:45:07 2021
OS/Arch:      linux/amd64

Podman package info (rpm -q podman) podman-3.4.4-1.fc35.x86_64

Info about your OS Fedora Silverblue 35

Additional context The flatpak version of gnome-builder uses flatpak-spawn (actually the dbus service directly but doesn't matter) with this set of minimal environment variables to run commands on the host. My jhbuild on the host is a wrapper which calls toolbox run -v --container jhbuild jhbuild. The problem described makes using jhbuild with gnome-builder on fedora silverblue impossible.

swick avatar Jan 24 '22 10:01 swick

A bit more poking around reveals that with XDG_RUNTIME_DIR set up everything works correctly.

swick avatar Jan 24 '22 10:01 swick