Container fails to start with error mounting /sys/fs/cgroup

Bug #1417909 reported by Christopher Townsend
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

It seems a fairly recent update to LXC has caused this. This is a privileged container. I will attach debug output when trying to start the container.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: lxc 1.1.0~rc4-0ubuntu1
ProcVersionSignature: Ubuntu 3.18.0-12.13-generic 3.18.4
Uname: Linux 3.18.0-12-generic x86_64
ApportVersion: 2.15.1-0ubuntu4
Architecture: amd64
CurrentDesktop: Unity
Date: Wed Feb 4 02:41:39 2015
InstallationDate: Installed on 2013-03-18 (687 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
SourcePackage: lxc
UpgradeStatus: Upgraded to vivid on 2014-10-20 (106 days ago)

Revision history for this message
Christopher Townsend (townsend) wrote :
Revision history for this message
Christopher Townsend (townsend) wrote :

This is the debug output when starting the container.

Revision history for this message
Christopher Townsend (townsend) wrote :

This is the generated LXC config file.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

thanks for submitting this bug. Could you tell us how you created the container?

You should be able to solve this by adding

lxc.mount.auto = sys

as the first line of your configuration file. Please let us know if that does not fix the container start.

Changed in lxc (Ubuntu):
status: New → Incomplete
Revision history for this message
Christopher Townsend (townsend) wrote :

Hey Serge,

Yes, adding 'lxc.mount.auto = sys' fixes the issue.

The container is an extracted ISO from http://cdimage.ubuntu.com/ubuntu-desktop-next/daily-live/current/vivid-desktop-amd64.iso for the Unity 8 in LXC project.

Changed in lxc (Ubuntu):
status: Incomplete → Confirmed
Changed in lxc (Ubuntu):
importance: Undecided → High
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Confused why this was marked confirmed/high prio, since there is as far as I ca ntell no bug in lxc here.

The container rootfs came from an iso, but it's the configuration which was bad. Wherever you got your configuration, fix it there to make sure to mount a sysfs before attempting to mount things under the sysfs.

Changed in lxc (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Christopher Townsend (townsend) wrote :

Hi Serge,

Ok, I understand I can fix this issue by adding that line in my config.

However, my gripe now with this is that my configuration was working with no issues prior to an update in LXC, then it broke for no apparent reason. Why was it automounting /sys before and not now? Shouldn't this be a default when pulling in /usr/share/lxc/config/ubuntu.common.conf as I do in my config?

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1417909] Re: Container fails to start with error mounting /sys/fs/cgroup

Quoting Christopher Townsend (<email address hidden>):
> Hi Serge,
>
> Ok, I understand I can fix this issue by adding that line in my config.
>
> However, my gripe now with this is that my configuration was working
> with no issues prior to an update in LXC, then it broke for no apparent
> reason. Why was it automounting /sys before and not now? Shouldn't
> this be a default when pulling in
> /usr/share/lxc/config/ubuntu.common.conf as I do in my config?

Your config includes /usr/share/lxc/config/common.conf, not
/usr/share/lxc/config/ubuntu.common.conf .

If you created a configuration using 'lxc-create', and that turned
out not forward-compatible, then I would consider that a bug. And
given the churn there has been recently I wouldn't be surprised if
there were such cases. However, if your config was hand-created,
then while I still consider this unfortunate, the newly increased
commonality between config layouts for different distributions is
worthwhile.

I wonder whether we can come up with a versioning/backup scheme for
configuration files to prevent this sort of thing in the future.
The trick is that for most containers we do want to take updated
configuration files, as that's the whole point.

Perhaps what we need, the real bug here, is better documentation
of what the *.$distro.* and *.common.* really mean and what a user
is safe to use.

 status: confirmed
 importance: medium

Changed in lxc (Ubuntu):
importance: High → Medium
status: Invalid → Confirmed
Revision history for this message
Christopher Townsend (townsend) wrote :

Hey Serge,

Thanks for looking into this more and better documentation would be most helpful.

I'm not really sure if it matters any more, but my python script does indeed ask to load /usr/share/lxc/config/ubuntu.common.conf. Here is the code snippet before I start adding custom config options:

    container.load_config("/etc/lxc/default.conf")
    container.load_config("/usr/share/lxc/config/ubuntu.common.conf")

At any rate, I'll add the sys automount in my config and be done with it on my end.

Thanks again!

Revision history for this message
Stéphane Graber (stgraber) wrote :

Just re-read through this whole bug.

It looks like what broke your setup is actually a bugfix in LXC wrt config inheritance.

Your config contains:
 - lxc.mount.auto =
 - lxc.mount.auto = cgroup:mixed

This instructs LXC (and that wasn't implemented right at first) to wipe all of lxc.mount.auto, and then set cgroup:mixed.
Doing so unsets the default which did contain sys:mixed, causing the breakage you had.

So the issue is that LXC actually does what you ask it to do now :)

Changed in lxc (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.