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

[CI:DOCS] rootless: Tell the user what was led to the error, not just what it is #9788

Merged

Conversation

andrewshadura
Copy link
Contributor

Users coming e.g. from Docker do not always read the manual and expect podman to not require sudo or uidmap, for them the default message is not very helpful:

Error: Cannot connect to the Podman socket, make sure there is a Podman REST API service running.:
cannot find newuidmap: exec: "newuidmap": executable file not found in $PATH

Adding a bit more context to this would help to nudge them into the right direction and tell them what to look for in the documentation:

cannot find newuidmap required for rootless mode (try running as root?): exec: "newuidmap": executable file not found in $PATH

Signed-off-by: Andrej Shadura <[email protected]>

@mheon
Copy link
Member

mheon commented Mar 23, 2021

Running as root there doesn't seem like the right suggestion? If newuidmap is missing, it needs to be installed.

@andrewshadura
Copy link
Contributor Author

Running as root there doesn't seem like the right suggestion? If newuidmap is missing, it needs to be installed.

Well, it is if they didn’t intend to run rootless.

@wladmis
Copy link

wladmis commented Mar 23, 2021

Running as root there doesn't seem like the right suggestion? If newuidmap is missing, it needs to be installed.

To be clarified running as root does not mean that there will be root inside of container. This can be helpful when userns is not used.

@mheon
Copy link
Member

mheon commented Mar 23, 2021

But very few people didn't mean to run rootless. Rootless is one of Podman's most-used features, and I'd say we have more rootless users than root users. This error message is nonsensical for them, the majority of our users.

@andrewshadura
Copy link
Contributor Author

How about try running as root if you didn’t want rootless mode?

@andrewshadura
Copy link
Contributor Author

andrewshadura commented Mar 23, 2021

Or do you have a different, better phrasing in mind? I think it’s important to point out both options exist.

@mheon
Copy link
Member

mheon commented Mar 23, 2021

@TomSweeneyRedHat @rhatdan You two might have opinions here?

@TomSweeneyRedHat
Copy link
Member

Beyond @rhatdan's comment, I'd a couple small nits in the text. Otherwise, TYVM @andrewshadura for the PR!

@giuseppe
Copy link
Member

newuidmap/newgidmap are required only for rootless mode with multiple IDs available.

It is still possible to use rootless but you are limited to just one user, together with ignore_chown_errors

@andrewshadura
Copy link
Contributor Author

newuidmap/newgidmap are required only for rootless mode with multiple IDs available.

It is still possible to use rootless but you are limited to just one user, together with ignore_chown_errors

How? I don’t think that’s documented very well, or at all?

@giuseppe
Copy link
Member

How? I don’t think that’s documented very well, or at all?

yes, unfortunately this part is not documented properly, but you can try adding: podman --storage-opt ignore_chown_errors ... when a single ID is available and all the files will be owned by just one user.

It is not done automatically (and I think it shouldn't) because potentially it can lead to security problems when the files ownership inside the container matters.

@rhatdan
Copy link
Member

rhatdan commented Mar 25, 2021

Right, we recommend this only for specific use cases like HPC environments.
Bottom line is you will only be able to run with a single UID within the container and that UID will be fully privileged to do read/write anything in the container. If this works for you then you can use it.

Also pushing these types of containers to container registries, might cause some issues.

@github-actions
Copy link

A friendly reminder that this PR had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Apr 26, 2021

@andrewshadura Still working on this?

@andrewshadura andrewshadura force-pushed the rootless-friendly-error branch 3 times, most recently from 9ce5143 to 43fa589 Compare April 27, 2021 08:50
Users coming e.g. from Docker do not always read the manual and
expect podman to not require sudo or uidmap, for them the default
message is not very helpful:

    Error: Cannot connect to the Podman socket, make sure there is a Podman REST API service running.:
    cannot find newuidmap: exec: "newuidmap": executable file not found in $PATH

Adding a bit more context to this would help to nudge them into the
right direction and tell them what to look for in the documentation:

    command required for rootless mode with multiple IDs: exec: "newuidmap": executable file not found in $PATH

Signed-off-by: Andrej Shadura <[email protected]>

[NO TESTS NEEDED]
@rhatdan rhatdan changed the title rootless: Tell the user what was led to the error, not just what it is [CI:DOCS] rootless: Tell the user what was led to the error, not just what it is Apr 27, 2021
@rhatdan
Copy link
Member

rhatdan commented Apr 27, 2021

LGTM

@rhatdan
Copy link
Member

rhatdan commented Apr 27, 2021

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewshadura, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 27, 2021
@rhatdan rhatdan removed the stale-pr label Apr 27, 2021
@TomSweeneyRedHat
Copy link
Member

LGTM

@TomSweeneyRedHat
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 27, 2021
@openshift-merge-robot openshift-merge-robot merged commit abda796 into containers:master Apr 27, 2021
@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
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants