Repository navigation
Description
Concourse 3.5.0 Docker images don't work on CentOS 7, kernel 4.12.9-1.el7.elrepo.x86_64, Docker 17.05.0-ce, build 89658be, run within Docker Swarm.
runc create: exit status 1: container_linux.go:264: starting container process caused "process_linux.go:247: running exec setns process for init caused \"exit status 38\""
Considering #1424, #1501, and the fact that I've had serious problems related to containers and volumes with almost every version of Concourse on a variety of environments for the past few months of versions (usually leaky containers, getting stuck after a few hours or days, or failing to start entirely), without wanting to sound unduly confrontational (or ungrateful)—on which environments does Concourse work through the Docker images? Pre 3.5.0, it at least ran on the described environment with a later-than-standard kernel, albeit periodically breaking every few days and needing the workers to be recreated, and experiencing frequent stalled workers and volumes reaped from underneath—even if it didn't work on any recent Kubernetes cluster I've been running, no matter what the kernel. But now, even the configuration which did work is broken, and now I need to roll back to 3.4.1 again (which also has plenty of problems). Is there an environment build matrix or something somewhere? As I say, I don't want to sound unduly confrontational, here—but having experienced so many problems (such as the ones I've reported previously) on a variety of installations, OSes, kernels, and image orchestrators, this is becoming frustrating. Is Concourse 3.x stable? :|
Update: I'm suspecting this is another kernel-related incompatibility; the kernel was recently upgraded within the channel I'm tracking to a later 4.12, and having rolled back to Concourse 3.4.1, this doesn't appear to work anymore either. So, it might not actually be Concourse 3.5.0 itself, but rather a wider issue.
Update: This also appears to be a problem with kernel 4.13.3-1.el7.elrepo.x86_64.
Update: This also appears to be a problem with stock kernel 3.10.0-693.2.2.el7.x86_64. In case you're wondering why I'm usually tracking mainline 4.x above, it's because on previous versions of Concourse workers didn't work pre-4.10.x (specifically, I couldn't get 3.x working). However, I just tried using upgraded CentOS 7 stock kernel (non-mainline), and get the same problem.
Activity
TiredPixel commentedon Sep 24, 2017
Update: On further investigation, it seems these failures are for different reasons. Previously, error messages bubbled right up to the UI. But on closer examination of the Worker logs, I see that the
exit status 38is caused by different things.Kernel
3.10.0-693.2.2.el7.x86_64fails with:This is actually as I'd expect, since Concourse requires kernels with
CAP_AUDIT_READ. So, let's ignore this part.Kernel
4.13.3-1.el7.elrepo.x86_64, however, fails with:Am I right in deducing that the main issue is
property not found: kawasaki.host-interface?TiredPixel commentedon Sep 24, 2017
Update: This also happens with Docker
17.06.2-ce, build cec0b72.[-]process_linux exec setns init exit status 38[/-][+]Kawasaki missing some parts[/+]TiredPixel commentedon Sep 27, 2017
Update: On a different cluster, Concourse 3.5.0 works for running with Kubernetes
1.7.0, Ubuntu16.04.3 LTS, non-default kernel4.10.0-28-generic. (This is a big improvement on some recent versions—hurrah! :) ) However, note #1669, which I believe to be unrelated to this issue, yet prevents me from declaring that Concourse 3.5.0 actually works properly on this environment.topherbullock commentedon Sep 27, 2017
TLDR: I feel like this is an issue with Garden / RunC on the kernel version you've mentioned, and not a Concourse issue.
There's an existing issue on RunC opencontainers/runc#1343 , which also mentions CentOS 7.x, which may point to a root cause in the kernel's support for user namespaces.
3.10.0is definitely a non-starter as you've deduced from the missingCAP_AUDIT_READ, but it seems like thehost-interfaceproperty cannot be found for containers being initialized.Here's where the error occurs in Guardian: https://github.com/cloudfoundry/guardian/blob/58d21e4cdc8c2ca8330760be81508a50cdadb632/kawasaki/networker.go#L330
It seems like that property should be saved here:
https://github.com/cloudfoundry/guardian/blob/master/kawasaki/networker.go#L156-L165
And
config_creator.gofigures out the host interface here:https://github.com/cloudfoundry/guardian/blob/master/kawasaki/config_creator.go#L75
I'm convinced the networking component would fail earlier if it was unable to determine the host interface, and this error is a side effect.
no-properties-for-container-skipping-destroy-networkseems to indicate that these properties required for configuring the container's network are never actually propagated, and so garden isn't able to tell RunC what to initialize, which may indicate a deeper issue withsetnsand more missing user namespace capabilities.TiredPixel commentedon Sep 27, 2017
@topherbullock, thanks for your reply, and indeed for your debugging notes. I'm inclined to agree with you, that it might not be Concourse itself at a top level—but I filed against this, because I think most people will consider it as such an issue given that this is the end-user program, and also because I'm not entirely sure where else I should file. It's also worth noting that the dependencies of Concourse come bundled, so it's not simply a case of swapping out a soft-dependency (indeed, I previously attempting patching runc version, but understandly lower components seem very sensitive to the version included).
However, I have experienced this on multiple kernels—admittedly all non-stock mainline builds. What's interesting is that Concourse 3.4.0 (? I can't remember which recent version wouldn't work), used to work, albeit it frequent
file not foundand apparent garbage-collection errors. But certainly, the kernel has been upgraded, and this no longer runs.Given your thoughts, I intend to continue trying to run this with different kernel versions; I'll seemingly need at least
< 4.13.3, but of course late enough to containCAP_AUDIT_READ. I'll try to get some time to try some other recent kernels, and report back.topherbullock commentedon Sep 27, 2017
@TiredPixel Thanks for letting us know of the issue and looking into this more. We're on track to update our included version of Garden RunC to the latest release, which may help here; I agree with your point about how coupled we are to specific versions.
I'm actually going to be spending a couple weeks with the Garden team next month, so I'm adding this to my list of things to cover with them while I'm there.
chrisdpa-tvx commentedon Sep 27, 2017
@topherbullock I managed to get this working on Centos by downgrading to
kernel-ml 4.10.0-1.el7.elrepo.x86_64and by adding a few selinux rules. In this instancesetenforce 0tail -f /var/log/audit/audit.log | grep denied > ~/audit.log.ccFYI it looks like this
TiredPixel commentedon Sep 28, 2017
@topherbullock, interesting to hear that you're considering updating the version of runc. Thanks for planning to cover it with the Garden team.
TiredPixel commentedon Sep 28, 2017
@chrisdpa-tvx, ahhhhhhhh, I didn't even explore SELinux; I'm running it
enforcingon CentOS, but not on Ubuntu. This could well explain some of the confusion I've had in trying to get something working on even previous kernels. I'll keep this in mind when I attempt to find a working combination.chrisdpa-tvx commentedon Sep 28, 2017
@TiredPixel I've got this working on
kernel-ml-4.13.3-1.el7.elrepo.x86_64in centos with SELinux updated using my method from yesterday... no downgrade needed. <= This is nice because 4.10 is no longer available in centos from repo = elrepo-kernel.TiredPixel commentedon Sep 29, 2017
@chrisdpa-tvx, thanks a lot for your suggestions about this! I confirm that I've been able to resolve the issue on kernel
4.13.3-1.el7.elrepo.x86_64, installing a custom SELinux policy module.The audit failure started off as:
This analysed as:
Iteratively analysing failures to build up a policy, these errors were reported in Concourse (the last one multiple iterations, as some denys don't result in a different exit code):
Building a final policy file (refactored by hand):
There shouldn't be any need to disable and enable SELinux, so far as I'm aware. Certainly, I didn't when developing this policy module.
I have no idea if it's actually safe to run with all these grants or not, but it does appear to be a minimal policy, for me. With this, Concourse is finally running. Hurrah!
Who in the chain is responsible for creating SELinux policies? Is this a runc problem, or somewhere else?
I also tried running Docker with
selinux-enabledmode, but then pretty much nothing worked. :)gezhiwei8899 commentedon Dec 18, 2017
@TiredPixel I still don't know how to solve the problem. : (
TiredPixel commentedon Dec 18, 2017
@gezhiwei8899, I'm sorry to hear that. I was able to to sort it in the end by applying my own SELinux policies, but other than that, I'm not aware of a solution. But I also haven't used Concourse much in the past few weeks, so it's possible it's been fixed on the latest version… I haven't heard anything, though.
gezhiwei8899 commentedon Dec 19, 2017
@TiredPixel thanks for replying.I update kernel to 4.0+.The problem solved. thanks!
TiredPixel commentedon Aug 12, 2018
Still happens on fresh install using kernel
4.17.14-1.el7.elrepo.x86_64. Applying custom policy again sorts it.TiredPixel commentedon Aug 12, 2018
The upgrade to kernel
4.xwas needed because stock3.10.0-862.9.1.el7.x86_64doesn't work, similar to before.bump etree tsa handlers mux clockwork goxmldsig genproto grpc
stale commentedon Jul 16, 2019
Beep boop! This issue has been idle for long enough that it's time to check
in and see if it's still important.
If it is, what is blocking it? Would anyone be interested in submitting a
PR or
continuing the discussion to help move things forward?
If no activity is observed within the next week, this issue will be
exterminatedclosed, in accordance with our stale issueprocess.