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.
<<<<<

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
<<<<<

I found something like this reported at this GitHub issue against lxc:
https://github.com/lxc/lxc/issues/2268
so I followed the advice there and ran the commands:

mount -o remount,rw /sys/fs/cgroup
mkdir /sys/fs/cgroup/devices
mount -t cgroup devices -o devices /sys/fs/cgroup/devices
mount -o remount,ro /sys/fs/cgroup

But that seems to be really bad, as now systemd-logind.service seems
to have broken and cannot be restarted, so I don't recommend doing
that!

I've restarted my system and started again.  The above solution is
very bad at least partly because /sys/fs/cgroup is type cgroup2.  But
I still can't start the LXC container, which makes running autopkgtest
impossible.

I did read the Debian Wiki pages on LXC and the
/usr/share/doc/lxc/README.Debian.gz file, but to no avail.  (I do have
apparmor installed.)

Any help much appreciated!

Best wishes,

   Julian


[1] https://lists.debian.org/debian-devel/2022/04/msg00372.html


-- System Information:
Debian Release: bookworm/sid
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.17.0-1-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_GB.UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages autopkgtest depends on:
ii  apt-utils       2.4.5
ii  libdpkg-perl    1.21.7
ii  procps          2:3.3.17-7+b1
ii  python3         3.10.4-1
ii  python3-debian  0.1.43

Versions of packages autopkgtest recommends:
ii  autodep8  0.26

Versions of packages autopkgtest suggests:
pn  fakemachine       <none>
pn  lxc               <none>
pn  lxd               <none>
pn  ovmf              <none>
pn  ovmf-ia32         <none>
pn  qemu-efi-aarch64  <none>
pn  qemu-efi-arm      <none>
pn  qemu-system       <none>
pn  qemu-utils        <none>
ii  schroot           1.6.10-12
pn  vmdb2             <none>

-- no debconf information

Reply via email to