-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Failed to join the user and pid namespaces of an existing runc container #960
Comments
@mrunalp , PTAL. |
@hmeng-19 Can you please try running your test again with the #950 patchset applied (it adds some debugging information so we can tell where nsenter fails). Also, if you want to use |
@cyphar , thanks for pointing out. I will give it a try. |
I just tried this out on Fedora 23 and it worked for me with runc master. Looking at your configs to see if anything is amiss. |
You can see that they are sharing user/pid namespaces. Container 1:
Container 2:
|
@hmeng-19 I think the issue is that you're manually setting the
|
@cyphar , every time I would use |
On Wed, Jul 20, 2016 at 04:02:58PM -0700, Aleksa Sarai wrote:
This will get easier if we can land opencontainers/runtime-tools#54 ;). |
@mrunalp , I tried the commands you provided and still got the same error. |
On Wed, Jul 20, 2016 at 03:27:14PM -0700, hmeng-19 wrote:
Shouldn't runC be joining the user namespace first? The strace has 5874 open("/proc/5736/ns/pid", O_RDONLY) = 5 See also 2 about join order. On the other hand, if you're root in setns(2) has a few possible reasons for EINVAL, including:
|
@hmeng-19 I just ported the fix. Please try again with 8a454e5. |
@cyphar , I tried 8a454e5 . |
Yeah, sorry. The code doesn't work currently if you're a privileged user (weirdly, it does work if you're setting up a rootless container). Part of that patch will fix your problem, but I'm also trying to fix another bug at the same time. The idea is that you want to unshare the user namespace before anything else, then set up all of the mappings and only then do we clone. |
The only |
I'm quite worried that I can't seem to reproduce the failures with our Jenkins instance (even though the failures are definitely real). It's probably a kernel version thing. :/ |
I started a runc container first, then started another container. The second
container tried to join the
user
andpid
namespace of the first container.The first container got started successfully, however, the second container was
failed to be started with the following error:
The strace log of the second container shows that
setns
failed to join theuser namespace of the first container.
Here is
config.json
of the first container:https://github.com/hmeng-19/logs/blob/master/runc_ns/c1/config.json
Here is
config.json
of the second container:https://github.com/hmeng-19/logs/blob/master/runc_ns/c2/config.json
Here is the strace log of the second container:
https://github.com/hmeng-19/logs/blob/master/runc_ns/strace.log
The
rootfs
I used for both of the two container are the busybox one:I am running Fedora 23 (Workstation Edition), and here is the kernel info:
I am testing runc using the latest master branch:
The text was updated successfully, but these errors were encountered: