lxc fails to install

Bug #1543170 reported by Ben Howard
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
init-system-helpers (Ubuntu)
New
Undecided
Unassigned
lxc (Ubuntu)
Invalid
Critical
Unassigned
sysvinit (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

LXC in Xenial fails to install. Since this is a seed package for the cloud-images, cloud image builds are now broken.

Setting up lxc (2.0.0~beta2-0ubuntu2) ...
invoke-rc.d: unknown initscript, /etc/init.d/lxc not found.
dpkg: error processing package lxc (--configure):
 subprocess installed post-installation script returned error exit status 100
dpkg: dependency problems prevent configuration of lxc-templates:
 lxc-templates depends on lxc (>= 0.8.0~rc1-4ubuntu43); however:
  Package lxc is not configured yet.

dpkg: error processing package lxc-templates (--configure):
 dependency problems - leaving unconfigured
Setting up lxcfs (0.17-0ubuntu3) ...
Running in chroot, ignoring request.
All runlevel operations denied by policy
invoke-rc.d: policy-rc.d denied execution of start.
Setting up xz-utils (5.1.1alpha+20120614-2ubuntu2) ...
update-alternatives: using /usr/bin/xz to provide /usr/bin/lzma (lzma) in auto mode
dpkg: dependency problems prevent configuration of lxd:
 lxd depends on lxc; however:
  Package lxc is not configured yet.

dpkg: error processing package lxd (--configure):

Tags: bot-comment
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1543170/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Revision history for this message
Ben Howard (darkmuggle-deactivatedaccount) wrote :

Repo steps -- RUN THIS ON AN INSTANCE YOU DON'T CARE ABOUT!

$ cat > livecd-builder.sh <<"EOM"
#!/bin/bash
build_d=${BUILD_D:-$(mktemp -d)}
cd ${build_d}

apt-get -qqy install livecd-rootfs

export MIRROR="http://archive.ubuntu.com/ubuntu"
export SUITE=xenial
export DISTRO=ubuntu
export PROJECT=ubuntu-cpc
export IMAGEFORMAT=ext4
export ARCH=amd64

# Check if we have apt-cacher-ng installed
nc -z -v -w2 localhost 3142 &&
    export MIRROR="http://localhost:3142/ubuntu/"

/usr/share/livecd-rootfs/live-build/auto/config
/usr/share/livecd-rootfs/live-build/auto/build

echo "RESULTS in ${build_d}"
EOM

$ sudo apt-get update
$ sudo apt-get -y install apt-cacher-ng livecd-rootfs
$ sudo bash -x livecd-builder.sh

affects: ubuntu → lxd (Ubuntu)
affects: lxd (Ubuntu) → lxc (Ubuntu)
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

This seems very similar to bug 1185364.

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

An easy way to reproduce this is using

sudo lxc-create -t ubuntu -n x1 -- -r xenial --packages lxc

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

I think the bug may be the following:

invoke-rc.d checks whether upstart or systemd is running by checking for

-d /run/systemd/system

inside the chroot, this would not be the case. Therefore it checks for the sysvinit script, which lxc does not provide.

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

Indeed, if I do

sudo debootstrap --verbose --components=main,universe --arch=amd64 --include=lxc xenial x

pause the debootstrap after it has expanded all the packages, edit x/usr/sbin/invoke-rc.d to change "elif test -d /run/systemd/system" on line 278 to "elif true', then the installation succeeds.

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

I just compared the content of lxc 1.1.5-0ubuntu6 which I'm assuming was the last working LXC version in cloud images and lxc 2.0.0~beta2-0ubuntu2 that we have now and neither provides any /etc/init.d script nor am I seeing any packaging change on our side which would explain this.

Packaging diff stat:

stgraber@dakara:~/data/code/lxc/lxc-pkg-ubuntu (dpm-xenial)$ git diff debian/1.1.5-0ubuntu6.. debian/ | filterdiff -x '*/patches/*' | diffstat
 .git-dpm | 14 +++++++-------
 changelog | 14 ++++++++++++++
 lxc.install | 1 +
 3 files changed, 22 insertions(+), 7 deletions(-)

So it indeed seems like something in the packaging tools (init-system-helpers, debhelper, invoke-rc.d, ...) caused the change in behavior, causing this bug for any package which ships upstart jobs or systemd units without an accompanying sysvinit job, as is the case of LXC.

Changed in lxc (Ubuntu):
status: Triaged → Invalid
Revision history for this message
Stéphane Graber (stgraber) wrote :

I'm marking the lxc task invalid as no packaging change occurred on lxc's side and this, admittedly rare, init script configuration has been supported for years and should still be supported.

Directly subscribing the containers team though so we can help track down the source of the regression.

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

Note that the analogous upstart test, 'initctl version', does work under chroot

sudo lxc-create -t download -n t1 -- -d ubuntu -r trusty -a amd64
sudo lxc-create -t download -n x1 -- -d ubuntu -r xenial -a amd64

chroot /var/lib/lxc/t1/rootfs initctl version
init (upstart 1.12.1)

chroot /var/lib/lxc/x1/rootfs ls /run
lock mount network resolvconf utmp

(of course, /run/systemd/system could not exist in a chroot)

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

Subscribing Martin Pitt who very recently merged init-system-helpers. I've not yet read the diff, but this seems like a fair bet as to what changed recently (last upload was Feb 5).

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1543170] Re: lxc fails to install

FWIW I dont' think this is a regression. I think this has always been
buggy. We just don't notice bc we don't generally debootstrap systems
with lxc any more.

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

Up until last week, cloud images were being built just fine with lxc and lxd in them, starting this week, they fail, that seems like a regression to me.

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

Oh, good.

Revision history for this message
Steve Langasek (vorlon) wrote :

This is a duplicate of bug #1543051, for which a fix has already been uploaded and is currently in xenial-proposed.

Changed in sysvinit (Ubuntu):
status: New → 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.