unprivlieged lxc_container: command get_cgroup failed to receive response, kernel 3.14.1 #206

Closed
vrodic opened this Issue Apr 23, 2014 · 19 comments

Projects

None yet

5 participants

@vrodic
vrodic commented Apr 23, 2014

Hello,
I get the lxc_container: command get_cgroup failed to receive response when trying to start the lxc container with 3.14.1 Linux from here: http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.14.1-trusty/

The 3.13.8, Ubuntu 14.04 current stock kernel (linux-image-extra-3.13.0-22-generic) also works.

@vrodic
vrodic commented Apr 23, 2014

3.13.11 from http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.13.11-trusty/ also works fine. Something in 3.14.1 or Ubuntu 3.14.1 specific configuration breaks it.

@stgraber
Member

Don't pass -d so you get the full error message.

@vrodic
vrodic commented Apr 23, 2014

Hi, here's the full error message

lxc-start -P /media/vedran/stor1s/vedran/lxc-debian7/ -n p1
lxc_container: call to cgmanager_create_sync failed: invalid request
lxc_container: Failed to create net_cls:p1
lxc_container: Error creating cgroup net_cls:p1
lxc_container: failed creating cgroups
lxc_container: failed to spawn 'p1'

@justinHume

Hi,

I'm using LXC 1.0.3 with Ubuntu 14.04.

I have encountered the same issue (command get_cgroup failed to receive response) when starting a container with -d, although with a different error message when starting the container without daemonizing:

lxc_container: invalid sequence number 1. expected 4
lxc_container: failed to spawn 'another2'
lxc_container: call to cgmanager_remove_sync failed: invalid request
lxc_container: Error removing cpuset:another2-1
lxc_container: call to cgmanager_remove_sync failed: invalid request
lxc_container: Error removing cpu:another2-1
lxc_container: call to cgmanager_remove_sync failed: invalid request
lxc_container: Error removing cpuacct:another2-1
lxc_container: call to cgmanager_remove_sync failed: invalid request
lxc_container: Error removing memory:another2-1
lxc_container: call to cgmanager_remove_sync failed: invalid request
lxc_container: Error removing devices:another2-1
lxc_container: call to cgmanager_remove_sync failed: invalid request
lxc_container: Error removing freezer:another2-1
lxc_container: call to cgmanager_remove_sync failed: invalid request
lxc_container: Error removing blkio:another2-1
lxc_container: call to cgmanager_remove_sync failed: invalid request
lxc_container: Error removing perf_event:another2-1
lxc_container: call to cgmanager_remove_sync failed: invalid request
lxc_container: Error removing hugetlb:another2-1

This occurs when I add the 'start' hook in a specific container's config: lxc.hook.start = /some/path.sh

If I remove this line from the config, I can start the container without problems. I've tried different hooks (lxc.hook.pre-start && lxc.hook.mount) and they also do not cause problems; it seems limited to lxc.hook.start.

Thanks,

Justin

@stgraber
Member

@vrodic your problem is because net_cls wasn't configured in systemd-logind in 14.04 as that cgroup controller wasn't enabled in the distro kernel.

I have since pushed an update to trusty-updates which enables those controllers, so rebooting your machine should now make lxc+cgmanager work fine as logind will setup all the controllers for you.

@justinHume Your bug is entirely unrelated, can you please file a separate report?

@stgraber stgraber closed this May 20, 2014
@vrodic
vrodic commented May 20, 2014

Hmm, I retested again with ubuntu current trusty kernel and latest systemd bits and it still works,
but 3.14.4 has the same problem starting a container that 3.14.1 had:

lxc_container: call to cgmanager_create_sync failed: invalid request
lxc_container: Failed to create net_cls:p1
lxc_container: Error creating cgroup net_cls:p1
lxc_container: failed creating cgroups
lxc_container: failed to spawn 'p1'

@stgraber
Member

Hmm, can you paste the content of /proc/self/cgroup ?

@vrodic
vrodic commented May 20, 2014

From my current 3.14.4 boot:

13:hugetlb:/user/1000.user/c2.session
12:net_prio:/
11:perf_event:/user/1000.user/c2.session
10:blkio:/user/1000.user/c2.session
9:net_cls:/
8:freezer:/user/1000.user/c2.session
7:devices:/user/1000.user/c2.session
6:memory:/user/1000.user/c2.session
5:cpuacct:/user/1000.user/c2.session
4:cpu:/user/1000.user/c2.session
3:cpuset:/user/1000.user/c2.session
2:name=systemd:/user/1000.user/c2.session

@stgraber
Member

Hmm, that looks like the old systemd... What version of systemd-services do you have installed?

@vrodic
vrodic commented May 20, 2014

ii systemd-services 204-5ubuntu20

@stgraber
Member

Right, so you are two versions behind, trusty currently has 204-5ubuntu20.2 which includes the fix you need.

Make sure you're using an up to date mirror and that trusty-updates is enabled in your sources.list, then upgrade and you should get the fixed version.

@vrodic
vrodic commented May 20, 2014

Thanks, sorry for wasting your time with my error prone upgrade workflow (I didn't replace raring with trusty for updates sources.list).

@stgraber
Member

Good to hear it was just that and that I didn't mess up the systemd fix :)

@vrodic
vrodic commented May 20, 2014

Actually, I need to reboot to find out :)

@vrodic
vrodic commented May 20, 2014

Yeah, confirmed fixed.

@SandipSingh14

Hey stgraber,
i'm facing something same as vrodic's issue, please suggest, attaching below error massage;

lxc-start: failed to attach 'vethMN1D30' to the bridge 'br0' : No such device
lxc-start: failed to create netdev
lxc-start: failed to create the network
lxc-start: failed to spawn 'apache'

@stgraber
Member

That's a different problem, the error you pasted can be one of two things:

  1. The "br0" bridge doesn't exist on your host, if so, just create it.
  2. Your kernel is lacking veth device support. You can check that by doing "ip link add type veth" as root. If you get an error message back, then your kernel is missing veth support.
@madsurgeon

Hi Stéphane,
I seem to be running into the same error as vrodic on utopic amd64 btrfs with kernel 3.16.0-30 and systemd 208-8ubuntu8.2.

The error message is:
lxc-start 1423396555.329 ERROR lxc_cgmanager - cgmanager.c:lxc_cgmanager_create:284 - call to cgmanager_create_sync failed: invalid request
lxc-start 1423396555.330 ERROR lxc_cgmanager - cgmanager.c:lxc_cgmanager_create:286 - Failed to create name=systemd:p1
lxc-start 1423396555.330 ERROR lxc_cgmanager - cgmanager.c:cgm_create:638 - Error creating cgroup name=systemd:p1
lxc-start 1423396555.333 ERROR lxc_start - start.c:lxc_spawn:864 - failed creating cgroups
lxc-start 1423396555.334 ERROR lxc_start - start.c:__lxc_start:1087 - failed to spawn 'p1'
lxc-start 1423396560.340 ERROR lxc_start_ui - lxc_start.c:main:337 - The container failed to start.
lxc-start 1423396560.340 ERROR lxc_start_ui - lxc_start.c:main:339 - To get more details, run the container in foreground mode.
lxc-start 1423396560.340 ERROR lxc_start_ui - lxc_start.c:main:341 - Additional information can be obtained by setting the --logfile and --logpriority options.

My /proc/self/cgroup:
12:name=systemd:/user.slice/user-1000.slice/session-c2.scope
11:perf_event:/user.slice/user-1000.slice/session-c2.scope
10:net_prio:/user.slice/user-1000.slice/session-c2.scope
9:net_cls:/user.slice/user-1000.slice/session-c2.scope
8:memory:/user.slice/user-1000.slice/session-c2.scope
7:hugetlb:/user.slice/user-1000.slice/session-c2.scope
6:freezer:/user.slice/user-1000.slice/session-c2.scope
5:devices:/user.slice/user-1000.slice/session-c2.scope
4:cpuset:/user.slice/user-1000.slice/session-c2.scope
3:cpuacct:/user.slice/user-1000.slice/session-c2.scope
2:cpu:/user.slice/user-1000.slice/session-c2.scope
1:blkio:/user.slice/user-1000.slice/session-c2.scope

@madsurgeon

I have to add that the above error occurs when running starting an unpriviledged container from a user without sudo rights and without X11 rights. A pristine adduser user.
There I see in addition to the above errors four lines
WARN: could not reopen tty: Permission denied

From the default Ubuntu user starting unpriviledged containers works. I just had to chmod +x ~/.config, ~/.local, and ~/.local/share.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment