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

Error: readlink: Permission denied: OCI permission denied #10912

Closed
edsantiago opened this issue Jul 12, 2021 · 23 comments
Closed

Error: readlink: Permission denied: OCI permission denied #10912

edsantiago opened this issue Jul 12, 2021 · 23 comments
Labels
flakes Flakes from Continuous Integration locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. rootless

Comments

@edsantiago
Copy link
Member

edsantiago commented Jul 12, 2021

This is one of those flakes that appear at random, in random tests, making it almost impossible for my flake-logger to isolate. Symptom is:

Running: podman [options] run [...]  quay.io/libpod/alpine:latest [command]
Error: readlink: Permission denied: OCI permission denied

One interesting thing: I see this (sometimes, not always) with run -d, implying that the error happens before detach.

Podman UserNS support [It] podman --userns=container:CTR

Podman pod create [It] podman pod container can override pod not sharing pid

Podman run [It] podman shared PID NS container share SELinux labels

Podman pod create [It] podman pod correctly sets up PIDNS

Podman top [It] podman pod top on pod with containers in same pid namespace

sys: podman selinux: shared context in (some) namespaces

@edsantiago edsantiago added flakes Flakes from Continuous Integration rootless labels Jul 12, 2021
@github-actions
Copy link

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

@edsantiago
Copy link
Member Author

Podman top [It] podman pod top on pod with containers in same pid namespace

Podman pod create [It] podman pod container can override pod not sharing pid

Podman pod create [It] podman pod correctly sets up PIDNS

@github-actions
Copy link

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

@edsantiago
Copy link
Member Author

I've been keeping flake logs for a few months, and on August 17 I wrote a tool to grep those logs. The last occurrence of "readlink" on the same line as "Permission denied" was August 10 (already logged in comment above). It's possible that the error message changed, also possible that the issue magically fixed itself. I don't think there's anything I can do aside from close the issue.

@edsantiago
Copy link
Member Author

Reopening: this is still happening.

Podman pod create [It] podman pod create with --userns=keep-id can add users

Podman pod create [It] podman pod create with --userns=auto

Podman pod create [It] podman pod create with --userns=keep-id

Podman pod create [It] podman pod create --userns=auto:size=%d

Two observations:

  • There's an awful lot of userns in the list above. Much more than I think can be explained by coincidence.
  • In logs where this happens, it seems to happen often, in other tests.

@edsantiago edsantiago reopened this Dec 6, 2021
@vrothberg
Copy link
Member

          podman pod create --userns=auto:size=%d
           /var/tmp/go/src/github.com/containers/podman/test/e2e/pod_create_test.go:739
         
         [BeforeEach] Podman pod create
           /var/tmp/go/src/github.com/containers/podman/test/e2e/pod_create_test.go:28
         [It] podman pod create --userns=auto:size=%d
           /var/tmp/go/src/github.com/containers/podman/test/e2e/pod_create_test.go:739
         Running: podman [options] pod create --userns=auto:size=500 --name testPod
         6092a09b3c751d0a768f5f7193034c2d793fbd3680fe7c42e344b8dcaf202fd4
         Running: podman [options] run --pod testPod quay.io/libpod/alpine:latest cat /proc/self/uid_map
                  0          1        500
         Running: podman [options] pod create --userns=auto:size=3000 --name testPod-1
         40ec609fac65ff52559ee8033d475074eb009f924d909ed11a42ab3b458a6bb9
         Running: podman [options] run --pod testPod-1 quay.io/libpod/alpine:latest cat /proc/self/uid_map
         Error: readlink: Permission denied: OCI permission denied

@giuseppe, could this be a crun issue?

@rhatdan
Copy link
Member

rhatdan commented Dec 16, 2021

No you are running a container within a Pod and already have set the userns size to 500, now you are attempting to set a container in the same user namesapce to use 3000 uids, which is not allowed.

What should happen here is --pod and userns option should conflict if container is sharing userns with the pod.

@rhatdan
Copy link
Member

rhatdan commented Dec 16, 2021

BTW We should do that for all of the namespace options. If you share a namespace with the pod, then you should use the options set within the pod.

@rhatdan
Copy link
Member

rhatdan commented Dec 16, 2021

593d090 just did this for conflicting --hostname when in a Pod.

@github-actions
Copy link

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

@rhatdan
Copy link
Member

rhatdan commented Jan 18, 2022

# ./bin/podman pod create --userns=auto:500  --name dan
Error: invalid option specified: "500"
# ./bin/podman pod create --userns=auto:size=500  --name dan
9af8b13ebbb413e871ba1cfabfeda3d09342988b2500dabec5394b7a095acdf0
# ./bin/podman create --userns=auto:size=3000 --pod dan fedora echo hi
Error: --userns and --pod cannot be set together

Looks like current code at least conflicts setting USERNS within a Pod that is using user namespace.

Not sure if this is enough to close down this issue.

@edsantiago
Copy link
Member Author

Most recent instance was Jan 12:

[sys] 236 podman selinux: shared context in (some) namespaces

That instance does not seem to have anything to do with userns or pods:

[+0933s] [not ok 236 podman selinux: shared context in (some) namespaces]()
         # (from function `die' in file test/system/helpers.bash, line 448,
         #  from function `run_podman' in file test/system/helpers.bash, line 221,
         #  in test file test/system/410-selinux.bats, line 125)
         #   `run_podman run --rm --pid container:myctr $IMAGE cat -v /proc/self/attr/current' failed with status 126
         # $ podman rm --all --force
         # $ podman ps --all --external --format {{.ID}} {{.Names}}
         # $ podman images --all --format {{.Repository}}:{{.Tag}} {{.ID}}
         # quay.io/libpod/testimage:20210610 9f9ec7f2fdef
         # $ podman run -d --name myctr quay.io/libpod/testimage:20210610 top
         # ac8e1d127b201330e12858aa66306362b24359e4bbf31b3f8f42283e97536b2f
         # $ podman exec myctr cat -v /proc/self/attr/current
         # system_u:system_r:container_t:s0:c68,c413^@
         # $ podman run --name myctr2 --ipc container:myctr quay.io/libpod/testimage:20210610 cat -v /proc/self/attr/current
         # system_u:system_r:container_t:s0:c68,c413^@
         # $ podman run --rm --pid container:myctr quay.io/libpod/testimage:20210610 cat -v /proc/self/attr/current
         # Error: readlink: Permission denied: OCI permission denied
         # [ rc=126 (** EXPECTED 0 **) ]

@github-actions
Copy link

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

@github-actions
Copy link

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

@edsantiago
Copy link
Member Author

Nothing in my logs since Jan 12; make of that what you will.

@rhatdan
Copy link
Member

rhatdan commented Apr 11, 2022

3 Months, Time to close...

@github-actions
Copy link

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

@rhatdan
Copy link
Member

rhatdan commented May 12, 2022

@edsantiago Close?

@edsantiago
Copy link
Member Author

No new instances since Jan 12. Okay, closing.

@edsantiago
Copy link
Member Author

Seen today in f37 rootless. Reopening.

  podman pod top on pod with containers in same pid namespace
...
$ podman [options] pod create --infra=false --share 
d8b01eac6d1ea48c3f663d4b63b3fc54ceef58e1922331c5aeda1c963141dcd4
$ podman [options] run -d --pod d8b01eac6d1ea48c3f663d4b63b3fc54ceef58e1922331c5aeda1c963141dcd4 quay.io/libpod/alpine:latest top -d 2
6e812b0d7d847c624707baafadfd1d128ac5bcedc18b0704683e8829422e7d23
$ podman [options] run -d --pod d8b01eac6d1ea48c3f663d4b63b3fc54ceef58e1922331c5aeda1c963141dcd4 --pid container:6e812b0d7d847c624707baafadfd1d128ac5bcedc18b0704683e8829422e7d23 quay.io/libpod/alpine:latest top -d 2
d4fe59cf384803bd5340d32240722a8601b588ca99d9da6fbae5756b74f53b53
$ podman [options] pod top d8b01eac6d1ea48c3f663d4b63b3fc54ceef58e1922331c5aeda1c963141dcd4
Error: error extracting PID namespace: readlink /proc/59714/ns/pid: permission denied

@edsantiago edsantiago reopened this May 1, 2023
@vrothberg
Copy link
Member

@giuseppe could this be a race in psgo?

@rhatdan
Copy link
Member

rhatdan commented Jul 28, 2023

@edsantiago waiting for response from you

@edsantiago
Copy link
Member Author

No instances since the one on May 1

@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 Oct 30, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
flakes Flakes from Continuous Integration locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. rootless
Projects
None yet
Development

No branches or pull requests

3 participants