Skip to content
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

toolbox: configuring working container: toolbox: failed to create user root with UID 0 #153

Closed
pojntfx opened this issue May 9, 2019 · 8 comments

Comments

@pojntfx
Copy link

pojntfx commented May 9, 2019

I just ran into this:

[pojntfx@thinkpadx1c3 k3s]$ toolbox create
toolbox: configuring working container: toolbox: failed to create user root with UID 0

Verbose output shows this:

[pojntfx@thinkpadx1c3 k3s]$ toolbox -v create
toolbox: Fedora generational core is f30
toolbox: base image is fedora-toolbox:30
toolbox: customized user-specific image is fedora-toolbox-root:30
toolbox: container is fedora-toolbox-root-30
toolbox: checking value /var/run/.heim_org.h5l.kcm-socket (Stream) of property Listen in sssd-kcm.socket
toolbox: parsing value /var/run/.heim_org.h5l.kcm-socket (Stream) of property Listen in sssd-kcm.socket
toolbox: checking if image fedora-toolbox-root:30 already exists
Error: error getting image "fedora-toolbox-root:30": unable to find a name and tag match for fedora-toolbox-root in repotags: no such image
toolbox: looking for image localhost/fedora-toolbox:30
toolbox: looking for image registry.fedoraproject.org/f30/fedora-toolbox:30
toolbox: base image fedora-toolbox:30 resolved to registry.fedoraproject.org/f30/fedora-toolbox:30
toolbox: trying to create working container toolbox-working-container-4a35bbfc-7242-11e9-9d8e-605718bba94a
toolbox: trying to configure working container toolbox-working-container-4a35bbfc-7242-11e9-9d8e-605718bba94a
useradd: user 'root' already exists
toolbox: failed to create user root with UID 0

Any idea what might be happening here? This is quite annoying and has been a bug from the point at which I've installed the system (Fedora Silverblue 30).

@debarshiray
Copy link
Member

What are the outputs of:

$ echo $USER
$ id -ru

Do you happen to be running toolbox create as root by any chance?

@pojntfx
Copy link
Author

pojntfx commented May 9, 2019

Actually, I was! This is the output without root:

[pojntfx@thinkpadx1c3 ~]$ echo $USER
pojntfx
[pojntfx@thinkpadx1c3 ~]$ id -ru
1000

If I try to run toolbox create without root, the following error is being thrown:

[pojntfx@thinkpadx1c3 ~]$ toolbox create
toolbox: failed to pull base image fedora-toolbox:30

And with -v:

[pojntfx@thinkpadx1c3 ~]$ toolbox -v create
toolbox: Fedora generational core is f30
toolbox: base image is fedora-toolbox:30
toolbox: customized user-specific image is fedora-toolbox-pojntfx:30
toolbox: container is fedora-toolbox-pojntfx-30
toolbox: checking value /var/run/.heim_org.h5l.kcm-socket (Stream) of property Listen in sssd-kcm.socket
toolbox: parsing value /var/run/.heim_org.h5l.kcm-socket (Stream) of property Listen in sssd-kcm.socket
toolbox: checking if image fedora-toolbox-pojntfx:30 already exists
Error: error getting image "fedora-toolbox-pojntfx:30": unable to find a name and tag match for fedora-toolbox-pojntfx in repotags: no such image
toolbox: looking for image localhost/fedora-toolbox:30
ERRO[0000] exit status 1                                
toolbox: looking for image registry.fedoraproject.org/f30/fedora-toolbox:30
ERRO[0000] exit status 1                                
toolbox: failed to pull base image fedora-toolbox:30

This is quite cryptic to me, as the system is able to pull the images as root.

@debarshiray
Copy link
Member

The inability to pull sounds like containers/buildah#1504

What do you get for rpm -q buildah on your host OS?

@pojntfx
Copy link
Author

pojntfx commented May 11, 2019

This is the output:

[pojntfx@thinkpadx1c3 ~]$ rpm -q buildah
buildah-1.7-18.git873f001.fc30.x86_64

I've just updated my system, but the following error still persists:

[pojntfx@thinkpadx1c3 ~]$ toolbox create
Image required to create toolbox container.
Download registry.fedoraproject.org/f30/fedora-toolbox:30 (500MB)? [y/N]: y
toolbox: failed to pull base image fedora-toolbox:30

And with -v:

[pojntfx@thinkpadx1c3 ~]$ toolbox -v create
toolbox: resolved absolute path for /usr/bin/toolbox to /usr/bin/toolbox
toolbox: TOOLBOX_PATH is /usr/bin/toolbox
toolbox: Fedora generational core is f30
toolbox: base image is fedora-toolbox:30
toolbox: customized user-specific image is fedora-toolbox-pojntfx:30
toolbox: container is fedora-toolbox-pojntfx-30
toolbox: checking value /var/run/.heim_org.h5l.kcm-socket (Stream) of property Listen in sssd-kcm.socket
toolbox: parsing value /var/run/.heim_org.h5l.kcm-socket (Stream) of property Listen in sssd-kcm.socket
toolbox: checking if image fedora-toolbox-pojntfx:30 already exists
toolbox: looking for image localhost/fedora-toolbox:30
ERRO[0000] exit status 1                                
toolbox: looking for image registry.fedoraproject.org/f30/fedora-toolbox:30
Image required to create toolbox container.
Download registry.fedoraproject.org/f30/fedora-toolbox:30 (500MB)? [y/N]: y
toolbox: pulling image registry.fedoraproject.org/f30/fedora-toolbox:30
ERRO[0000] exit status 1                                
toolbox: failed to pull base image fedora-toolbox:30

After some debugging, I think I've found out the root cause of the problem; a wrongly configured ${HOME}/.docker/config.json. As a "solution", I've simply deleted ${HOME}/.docker. It now works! Thanks for all the help.

@pojntfx pojntfx closed this as completed May 11, 2019
@debarshiray
Copy link
Member

Wow, I'd have never expected ~/.docker/config.json to have a role in this.

@pojntfx
Copy link
Author

pojntfx commented May 17, 2019

Yes, it's quite weird indeed. I've used the snap version of Docker for some time and I've used my own Docker registry, I guess that has been the problem. Found that out by pulling the mage manually with podman.

@debarshiray
Copy link
Member

I see, but Toolbox doesn't use Docker at all. Only Podman. :)

@pojntfx
Copy link
Author

pojntfx commented May 18, 2019

Exactly. Is it possible that Podman has read the Docker config file and thus has failed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants