-
Notifications
You must be signed in to change notification settings - Fork 15
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 -u fails with unknown user error looking up user "root" #25
Comments
unknown user error looking up user "root"
unknown user error looking up user "root"
To chime in on this - while the subsequent launch after creation seems to work, password-less sudo is broken/not setup correctly. |
Commenting out the line doing the copy of the init-script to the podman container fixes the problem for me (for now). The container gets set up correctly without it - sudo is working is just fine. Looking at the bug reports for Podman 3.x there seems to be some issues revolving doing 'podman cp' as non-root user, maybe the root cause is to be found there. Side-Note: The temporary files doing the sudo setup created as "${HOME}/.${TOOLBOX_NAME}-user-setup-XXXXXX.sh" are never removed, cluttering $HOME. If they are intended to stay around, wouldn't they be better suited to live in a tmpfs such as /tmp? |
Mmm... I've just tried, and it is working fine here:
And sudo works, once inside:
So, what am I missing? |
❯ podman --version
podman version 3.0.1
❯ id
uid=1000(azmo) gid=1000(azmo) groups=1000(azmo),100(users),108(libvirt),495(wheel)
❯ /tmp/microos-toolbox/toolbox -u
Spawning a container 'toolbox-azmo-user' with image 'registry.opensuse.org/opensuse/toolbox'
5ee4d8f0f086cd6b2c0a21634f5c4623f75c35228afc635599b0a4a3fc0c1705
WARN[0000] Path "/etc/SUSEConnect" from "/etc/containers/mounts.conf" doesn't exist, skipping
WARN[0000] Path "/etc/zypp/credentials.d/SCCcredentials" from "/etc/containers/mounts.conf" doesn't exist, skipping
toolbox-azmo-user
Setting up user 'azmo' (with 'sudo' access) inside the container...
(NOTE that, if 'sudo' and related packages are not present in the image already,
this may take some time. But this will only happen now that the toolbox is being created)
Error: 2 errors occurred:
* error determining run uid: user: unknown user error looking up user "root"
* error copying from host: copier: get: "/home/azmo/.toolbox-azmo-user-user-setup-6WBqQ2.sh": error copying /home/azmo/.toolbox-azmo-user-user-setup-6WBqQ2.sh: io: read/write on closed pipe Weird indeed, it's definitely not working here. I don't have a .toolboxrc though and my container image is complaining about the two SUSE specific files missing - yours isn't. Might be something there? If not - I am quite lost to be honest. |
Ah, yes, I don't yet have podman 3 on my workstation. I just tried in a VM, and it fails as described. The only difference between the two seems to be the podman version, so maybe it is an issue there? Do you have any link?
Ah, wow, no, /tmp is not good for security reasons. But they're not meant to stay, it's just an oversight, and one that is easily fixed. thanks for reporting |
Well, I stumpled across this bugreport and there have been quite some commits regarding
Thanks! 👍 |
Ok, thinking more about this, I do see now why it works if you don't do the However...
podman exec --user root "${TOOLBOX_NAME}" rm "${tmp_user_setup}" it should remove it. Maybe the ones that you see are those from failed runs, or something like that? I'll see about adding an |
I just tested with the |
We needed to copy the setup script (for user toolboxes), when they were generated in /tmp on the host. But they're currently generated directly in $HOME, and since we bind mount $HOME... well, it's just already there (and one can even argue that it's a bug copying it!). So, not copying is the right thing do to and, nicely enough, it also workarounds what apparently is a podman 3 issue with 'podman cp', basically fixing issue openSUSE#25 too. While there, add cleanup logic for the same user setup script. In fact, if everything goes fine, the script is removed by the toolbox itself (after executing it). But if there's an error and we bail, it may stick around, cluttering the home directory. Signed-off-by: Dario Faggioli <[email protected]>
We needed to copy the setup script (for user toolboxes), when they were generated in /tmp on the host. But they're currently generated directly in $HOME, and since we bind mount $HOME... well, it's just already there (and one can even argue that it's a bug copying it!). So, not copying is the right thing do to and, nicely enough, it also workarounds what apparently is a podman 3 issue with 'podman cp', basically fixing issue openSUSE#25 too. While there, add cleanup logic for the same user setup script. In fact, if everything goes fine, the script is removed by the toolbox itself (after executing it). But if there's an error and we bail, it may stick around, cluttering the home directory. Signed-off-by: Dario Faggioli <[email protected]>
Ok, #26 , which is now merged, should fix all the issues reported here. |
Thank you! |
Using
toolbox -u
fails, but the container is created and the second time it works.Environment:
The text was updated successfully, but these errors were encountered: