-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Podman user mode doesn't work after uid change #11377
Comments
@ananthb don't you need restart or re-login (using the |
AFAIK even mere addition of a user to a group won't take effect immediately I would expect similar for uid. |
This was after rebooting. |
what is output of |
Podman caches the temporary files directory in use in the database, to ensure it always remains constant; in this case, we likely cached |
@mheon podman system reset also fails with the same error. I finally fixed it by manually deleting $HOME/.local/share/containers, but I'm interested in figuring out how to fix it permanently. |
That should be a permanent fix - the DB is gone, so we'll now cache your new paths, and Podman should go back to working as expected. If you plan on changing UID/GID again, this will unfortunately happen again; it's not really something we accounted for in Podman's architecture. |
@mheon would it be possible to detect the change and update the DB on podman start up? |
Could theoretically be added to |
I'm willing to take a look. Any pointers on where I can start reading the DB code? @mheon @matejvasek |
@ananthb had a chance to look at libpod? Are you still interested to work on it? |
@giuseppe I'm still interested but I haven't had the time to look at it yet. I'm going to start now. |
The DB interface code lives in https://github.com/containers/podman/blob/main/libpod/boltdb_state.go and https://github.com/containers/podman/blob/main/libpod/boltdb_state_internal.go I think you're looking at several different stages here - we need to change the |
I tried digging into this change but it seems like a lot of effort for not a lot of payoff. I'd like to contribute to podman, but I'd like to try something else out. The easy fix to this is to just nuke the storage folder anyway and that works for me. Do you want to keep this issue around or close it @mheon? Also is there anything else I can work on? I have some hours I'd like to contribute. |
We can keep it around in case anyone else would like to take a crack at it. If you'd like to work on an issue, something like #12063 might be good? We've stopped applying the Good First Issue label, unfortunately, I'll try to remember to add it again to simple issues. |
Awesome thanks. Might even circle back to this once I have a better grasp of how things work. |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
@ananthb are you still interested to work on this issue? |
Yeah! I definitely have more time to look at this now. |
A friendly reminder that this issue had no activity for 30 days. |
I am closing this issue since migrating to a new UID is a very specific corner case and it seems to me not trivial to maintain in the long term as we'll have to deal with different run directories and storage directories, as well as volumes, so every time we add a new feature we must make sure it can be migrated to a new UID. If you are still interested in working on it though, please feel free to open a PR and it will be easier to evaluate its maintenance costs. |
@giuseppe Btw. The I think that at-least the reset system command should be aware of the possibility that the user has a new ID. Additionally, the error: I recommend that this issue is reopened. |
/kind bug
Description
I changed my user account's id from 1001 to 1000 on a system where I had already started using podman as that user.
After changing ids, all podman operations fail with
Error: error creating tmpdir: mkdir /run/user/1001: permission denied
.Steps to reproduce the issue:
usermod -u <new-uid> <user> && usermod -g <new-gid> <group>
.Describe the results you received:
Podman fails trying to create a run directory for the wrong user id.
Describe the results you expected:
Podman works correctly with the new user id.
Additional information you deem important (e.g. issue happens only occasionally):
Root podman still works correctly on this machine. I'm unable to run even
podman version
as my user.Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Physical on a raspberry pi 4.
The text was updated successfully, but these errors were encountered: