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

"open /etc/subuid: no such file or directory" error message #6572

Closed
Nuc1eoN opened this issue Jun 11, 2020 · 8 comments
Closed

"open /etc/subuid: no such file or directory" error message #6572

Nuc1eoN opened this issue Jun 11, 2020 · 8 comments
Assignees
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. kind/documentation Categorizes issue or PR as related to documentation. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@Nuc1eoN
Copy link

Nuc1eoN commented Jun 11, 2020

I'm a new podman user using ArchLinux; I was a docker user before.

I have tried running podman unprivileged but I am getting an error message with no explanation:
ERRO[0000] cannot find mappings for user <username>: open /etc/subuid: no such file or directory

Appears there already was a bug report about improving the guidance and documentation for this case in #1755

However no such documentation or guidance seems to be in place? Just throwing our an error message without any explanation is definitely not the best user experience, esp. if you migrate from docker to give podman a try.

@TomSweeneyRedHat
Copy link
Member

@Nuc1eoN thanks for the feedback, that message could most definitely have a better resolution text. I believe the /etc/subuid & /etc/subgid files were not setup appropriately. The best doc available at the moment that I know is: https://github.com/containers/libpod/blob/master/docs/tutorials/rootless_tutorial.md

hth, and we'll see if we can make that message a bit more intuitive.

@mheon mheon added the kind/documentation Categorizes issue or PR as related to documentation. label Jun 11, 2020
@rhatdan
Copy link
Member

rhatdan commented Jun 11, 2020

Well it is in the man page.

man podman
...
Rootless mode
       Podman can also be used as non-root user.  When podman runs in rootless mode, a user namespace is automatically created for the user, defined in /etc/sub‐
       uid and /etc/subgid.

       Containers created by a non-root user are not visible to other users and are not seen or managed by Podman running as root.

       It is required to have multiple uids/gids set for an user.  Be sure the user is present in the files /etc/subuid and /etc/subgid.

       If you have a recent version of usermod, you can execute the following commands to add the ranges to the files

              $ sudo usermod --add-subuids 10000-75535 USERNAME
              $ sudo usermod --add-subgids 10000-75535 USERNAME

       Or just add the content manually.

              $ echo USERNAME:10000:65536 >> /etc/subuid
              $ echo USERNAME:10000:65536 >> /etc/subgid

       See the subuid(5) and subgid(5) man pages for more information.

       Images are pulled under XDG_DATA_HOME when specified, otherwise in the home directory of the user under .local/share/containers/storage.

       Currently the slirp4netns package is required to be installed to create a network device, otherwise rootless containers need to run in the network  names‐
       pace of the host.

   NOTE: Unsupported file systems in rootless mode
       The  Overlay file system (OverlayFS) is not supported in rootless mode.  The fuse-overlayfs package is a tool that provides the functionality of OverlayFS
       in user namespace that allows mounting file systems in rootless environments.  It is recommended to install the fuse-overlayfs package and to enable it by
       adding mount_program = "/usr/bin/fuse-overlayfs" under [storage.options] in the $HOME/.config/containers/storage.conf file.

       The  Network  File  System (NFS) and other distributed file systems (for example: Lustre, Spectrum Scale, the General Parallel File System (GPFS)) are not
       supported when running in rootless mode as these file systems do not understand user namespace.  However, rootless Podman can make use of an  NFS  Homedir
       by modifying the $HOME/.config/containers/storage.conf to have the graphroot option point to a directory stored on local (Non NFS) storage.

       For more information, please refer to the Podman Troubleshooting Page ⟨https://github.com/containers/libpod/blob/master/troubleshooting.md⟩.

@Nuc1eoN
Copy link
Author

Nuc1eoN commented Jun 11, 2020

Maybe then at least, it should mention that you can find this in the man pages and where exactly.

Or give a brief description of the problem. Because cannot find mappings for user bob: open /etc/subuid: no such file or directory does not help a first time user without googling.

@rhatdan
Copy link
Member

rhatdan commented Jun 13, 2020

@giuseppe @vrothberg WDYT
Currently we don't have any errors to tell users to examine man pages. We could change this error to say "Examine Rootless mode in man podman.
I think this would be ok since this will only happen on Linux, and we can figure the man pages will exists on a linux distribution.

@vrothberg
Copy link
Member

Sounds good to me 👍 Some error messages are hard to decrypt and sometimes even harder to find a potential solution. Pointing to the man page directly could be really helpful.

@vrothberg
Copy link
Member

@Nuc1eoN, are you interested in opening a pull request to change the error message?

@Nuc1eoN
Copy link
Author

Nuc1eoN commented Jun 15, 2020

Haha thanks for asking, but currently I am pretty occupied with other tasks :D

@vrothberg vrothberg added Contributor Wanted Good First Issue This issue would be a good issue for a first time contributor to undertake. labels Jun 16, 2020
@rhatdan
Copy link
Member

rhatdan commented Jun 16, 2020

@ryanchpowell PTAL

@rhatdan rhatdan closed this as completed Jun 22, 2020
mheon pushed a commit to mheon/libpod that referenced this issue Jun 24, 2020
Improve the error message for rootless mode.

Git-Url: containers#6572
Signed-off-by: Douglas Schilling Landgraf <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. kind/documentation Categorizes issue or PR as related to documentation. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

6 participants