[pkg-lxc-devel] Bug#1010437: autopkgtest: autopkgtest-build-lxc fails to build working lxc environment

Julian Gilbey jdg at debian.org
Mon May 2 08:21:13 BST 2022


clone 1010437 -1
reassign -1 lxc 1:4.0.11-1
retitle -1 lxc: as root, lxc-start fails to start with cgroups/cgfsng error setting up limits for devices
retitle 1010437 autopkgtest-build-lxc: eatmydata gives lots of LD_PRELOAD warnings
thanks

I have now run the autopkgtest-build-lxc script "by hand" to see where
the issues are arising in the issue below, and I think there are two
separate things going on, hence splitting this bug report into two.
A few comments interspersed below.

On Sun, May 01, 2022 at 04:03:09PM +0100, Julian Gilbey wrote:
> Package: autopkgtest
> Version: 5.21
> Severity: normal
> 
> (I realise that posting this on debian-devel [1] was probably not the
> most appropriate place, as it's actually a bug report.)
> 
> I am not sure whether this is a bug in autopkgtest-build-lxc, a bug in
> lxc itself or a user error.  Please feel free to redirect as
> appropriate!
> 
> This is what I did:
> 
> Step 1: I installed the lxc and autopkgtest packages
> That went smoothly.  (lxc version 1:4.0.11-1, autopkgtest version
> 5.21; autopkgtest was already installed, and I installed lxc from 
> 
> Step 2: I ran the command "autopkgtest-build-lxc debian sid"
> as root.  I got various warning messages to begin with:
> 
> >>>>>
> lxc-create: autopkgtest-sid: storage/btrfs.c: btrfs_create: 938 Inappropriate ioctl for device - Failed to create btrfs subvolume "/var/lib/lxc/autopkgtest-sid/rootfs"
> lxc-create: autopkgtest-sid: storage/zfs.c: zfs_create: 735 Failed to create zfs dataset "zfs:lxc/autopkgtest-sid": lxc-create: autopkgtest-sid: utils.c: run_command_internal: 1588
> lxc-create: autopkgtest-sid: storage/lvm.c: do_lvm_create: 165 Failed to create logical volume "autopkgtest-sid":   Volume group "lxc" not found
>   Cannot process volume group lxc
> lxc-create: autopkgtest-sid: storage/lvm.c: lvm_create: 623 Error creating new logical volume "lvm:/dev/lxc/autopkgtest-sid" of size "1073741824 bytes"
> <<<<<
> 
> after which things ran smoothly for a bit:
> 
> >>>>>
> debootstrap is /usr/sbin/debootstrap
> Checking cache download in /var/cache/lxc/debian/rootfs-sid-amd64 ... 
> Downloading debian minimal ...
> I: Target architecture can be executed
> I: Retrieving InRelease 
> [... downloading and installing base system ...]
> I: Base system installed successfully.
> Download complete.
> <<<<<
> 
> but then there were lots of warning messages about libeatmydata.so
> interspersed with information messages; I assume that these are mostly
> harmless:
> 
> >>>>>
> Copying rootfs to /var/lib/lxc/autopkgtest-sid/rootfs...ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
> ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
> Generating locales (this might take a while)...
> ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
>   en_GB.UTF-8ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
> [... lots more similar warnings and messages ...]
> ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
> <<<<<

This looks to be similar to
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=963508 so I wonder
whether the apparmor settings for lxc mean that LD_PRELOAD cannot be
used with lxc, and LD_PRELOAD is needed by eatmydata.  This is a minor
issue with autopkgtest-build-lxc; maybe it should just not try using
eatmydata, or maybe there is some way to change the lxc apparmor
settings (if indeed that is the thing preventing the use of
LD_PRELOAD) to allow eatmydata?  I don't know anything about apparmor,
so I am just speculating here.


> But then I received several fatal error messages:
> 
> >>>>>
> lxc-start: autopkgtest-sid: lxccontainer.c: wait_on_daemonized_start: 867 Received container state "ABORTING" instead of "RUNNING"
> lxc-start: autopkgtest-sid: tools/lxc_start.c: main: 306 The container failed to start
> lxc-start: autopkgtest-sid: tools/lxc_start.c: main: 309 To get more details, run the container in foreground mode
> lxc-start: autopkgtest-sid: tools/lxc_start.c: main: 311 Additional information can be obtained by setting the --logfile and --logpriority options
> <<<<<
> 
> Since autopkgtest-build-lxc doesn't allow a --logfile option, I
> attempted to start the container manually, using the command
>   lxc-start -n autopkgtest-sid --logfile /tmp/lxc.log --logpriority INFO
> and got the following warnings and errors in the log file (I've
> excluded the INFO entries):
> 
> >>>>>
> lxc-start autopkgtest-sid 20220501145802.680 NOTICE   conf - conf.c:lxc_setup:4450 - The container "autopkgtest-sid" is set up
> lxc-start autopkgtest-sid 20220501145802.681 WARN     cgfsng - cgroups/cgfsng.c:get_hierarchy:142 - There is no useable devices controller
> lxc-start autopkgtest-sid 20220501145802.681 ERROR    cgfsng - cgroups/cgfsng.c:cg_legacy_set_data:2675 - No such file or directory - Failed to setup limits for the "devices" controller. The controller seems to be unused by "cgfsng" cgroup driver or not enabled on the cgroup hierarchy
> lxc-start autopkgtest-sid 20220501145802.681 ERROR    cgfsng - cgroups/cgfsng.c:cgfsng_setup_limits_legacy:2742 - No such file or directory - Failed to set "devices.deny" to "a"
> lxc-start autopkgtest-sid 20220501145802.681 ERROR    start - start.c:lxc_spawn:1890 - Failed to setup legacy device cgroup controller limits
> lxc-start autopkgtest-sid 20220501145802.681 ERROR    lxccontainer - lxccontainer.c:wait_on_daemonized_start:867 - Received container state "ABORTING" instead of "RUNNING"
> lxc-start autopkgtest-sid 20220501145802.681 ERROR    lxc_start - tools/lxc_start.c:main:306 - The container failed to start
> lxc-start autopkgtest-sid 20220501145802.681 ERROR    lxc_start - tools/lxc_start.c:main:309 - To get more details, run the container in foreground mode
> lxc-start autopkgtest-sid 20220501145802.681 ERROR    lxc_start - tools/lxc_start.c:main:311 - Additional information can be obtained by setting the --logfile and --logpriority options
> lxc-start autopkgtest-sid 20220501145802.682 ERROR    start - start.c:__lxc_start:2068 - Failed to spawn container "autopkgtest-sid"
> lxc-start autopkgtest-sid 20220501145802.682 WARN     start - start.c:lxc_abort:1038 - No such process - Failed to send SIGKILL via pidfd 20 for process 389747
> <<<<<
> [...]

This also happens when I create the lxc container manually (as root),
using the recipe in autopkgtest-build-lxc:
  lxc-create -B best --name=autopkgtest-unstable -t debian -- -r unstable
the resulting container fails to start in the same way as just
described (when lxc-start is run as root).

This is the bug report against lxc.

Best wishes,

   Julian



More information about the Pkg-lxc-devel mailing list