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

Rawhide: rootless, remote: podman build: failed to create bridge "cni-podman0": could not add "cni-podman0": EPERM #12989

Closed
edsantiago opened this issue Jan 24, 2022 · 7 comments · Fixed by #12996
Assignees
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. remote Problem is in podman-remote rootless

Comments

@edsantiago
Copy link
Member

Ton of failures in rootless gating tests, on latest rc2 build:

# $ podman-remote build -t nomtab /tmp/podman_bats.WiYj4J/build-test
# STEP 1/2: FROM quay.io/libpod/testimage:20210610
# STEP 2/2: RUN rm /etc/mtab
# error running container: did not get container start message from parent: EOF
# Error: error building at STEP "RUN rm /etc/mtab": plugin type="bridge" failed (add): cni plugin bridge failed: failed to create bridge "cni-podman0": could not add "cni-podman0": operation not permitted
# [ rc=125 (** EXPECTED 0 **) ]

No idea if this is real or a flake. If the latter, it's not one I've ever seen before. I will spin up a virt and try to reproduce today, but I'm still catching up from the weekend.

@edsantiago edsantiago added rootless remote Problem is in podman-remote labels Jan 24, 2022
@edsantiago
Copy link
Member Author

Here's the log from podman system service:

WARN[0072] Failed to load cached network config: network podman not found in CNI cache, falling back to loading network podman from disk
WARN[0073] 1 error occurred:
        * plugin type="bridge" failed (delete): cni plugin bridge failed: mkdir /var/lib/cni: permission denied

@edsantiago
Copy link
Member Author

Reproducer:

$ printf "FROM quay.io/libpod/alpine:latest\nRUN true\n" | podman-remote build -t foo -
STEP 1/2: FROM quay.io/libpod/alpine:latest
STEP 2/2: RUN true
WARN[1035] Failed to load cached network config: network podman not found in CNI cache, falling back to loading network podman from disk
WARN[1035] 1 error occurred:
        * plugin type="bridge" failed (delete): cni plugin bridge failed: mkdir /var/lib/cni: permission denied

error running container: did not get container start message from parent: EOF
Error: error building at STEP "RUN true": plugin type="bridge" failed (add): cni plugin bridge failed: failed to create bridge "cni-podman0": could not add "cni-podman0": operation not permitted

(podman server running in bg, so output is intermingled)

@Luap99
Copy link
Member

Luap99 commented Jan 24, 2022

I think the problem here is that we use code which should only be used as root, we need to set the correct buildah isolation which is only done for local.

Luap99 added a commit to Luap99/libpod that referenced this issue Jan 24, 2022
When we run rootless buildah needs to have IsolationOCIRootless set
otherwise it will run code which cannot be used as rootless user.
Podman should use the buildah default if possible and change it to
rootless mode if needed.

[NO NEW TESTS NEEDED] Should be covered by existing tests once we have
podman-remote rootless tests.

Fixes containers#12989

Signed-off-by: Paul Holzinger <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Jan 24, 2022

So the API Handler needs to realize it is running in rootless mode and set the network as such.

@Luap99
Copy link
Member

Luap99 commented Jan 24, 2022

PR #12996

@Luap99 Luap99 self-assigned this Jan 24, 2022
@TomSweeneyRedHat
Copy link
Member

So just to verify, is this issue only a problem for remote rootless, or all rootless? @edsantiago

edsantiago added a commit to edsantiago/libpod that referenced this issue Jan 24, 2022
Minimal: only test Fedora.Latest.

Reason: podman 4.0.0-0.2.rc2 broke bodhi gating tests:
        containers#12989

Requires skipping two recently-added tests that use 'podman unshare',
which doesn't work on remote.

Signed-off-by: Ed Santiago <[email protected]>
@TomSweeneyRedHat
Copy link
Member

Answered off line, this is only a problem with rootless remote build.

patrycja-guzik pushed a commit to patrycja-guzik/podman that referenced this issue Feb 15, 2022
When we run rootless buildah needs to have IsolationOCIRootless set
otherwise it will run code which cannot be used as rootless user.
Podman should use the buildah default if possible and change it to
rootless mode if needed.

[NO NEW TESTS NEEDED] Should be covered by existing tests once we have
podman-remote rootless tests.

Fixes containers#12989

Signed-off-by: Paul Holzinger <[email protected]>
patrycja-guzik pushed a commit to patrycja-guzik/podman that referenced this issue Feb 15, 2022
Minimal: only test Fedora.Latest.

Reason: podman 4.0.0-0.2.rc2 broke bodhi gating tests:
        containers#12989

Requires skipping two recently-added tests that use 'podman unshare',
which doesn't work on remote.

Signed-off-by: Ed Santiago <[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 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. remote Problem is in podman-remote rootless
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants