lxc-start throws Segmentation fault

Tommmii

Well-Known Member
Jun 11, 2019
66
12
48
53
Hi all,

I force-stopped a non-responsive container, and now it won't start.
Have searched for something similar, but the search-results don't apply to this case.

Code:
root@pve:~# pveversion -v
proxmox-ve: 6.1-2 (running kernel: 5.3.13-1-pve)
pve-manager: 6.1-5 (running version: 6.1-5/9bf06119)
pve-kernel-5.3: 6.1-1
pve-kernel-helper: 6.1-1
pve-kernel-5.0: 6.0-11
pve-kernel-4.15: 5.4-6
pve-kernel-5.3.13-1-pve: 5.3.13-1
pve-kernel-5.3.10-1-pve: 5.3.10-1
pve-kernel-5.0.21-5-pve: 5.0.21-10
pve-kernel-5.0.21-4-pve: 5.0.21-9
pve-kernel-4.15.18-18-pve: 4.15.18-44
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.2-pve4
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: 0.8.35+pve1
ksm-control-daemon: 1.3-1
libjs-extjs: 6.0.1-10
libknet1: 1.13-pve1
libpve-access-control: 6.0-5
libpve-apiclient-perl: 3.0-2
libpve-common-perl: 6.0-9
libpve-guest-common-perl: 3.0-3
libpve-http-server-perl: 3.0-3
libpve-storage-perl: 6.1-3
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve3
lxc-pve: 3.2.1-1
lxcfs: 3.0.3-pve60
novnc-pve: 1.1.0-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.1-1
pve-cluster: 6.1-2
pve-container: 3.0-15
pve-docs: 6.1-3
pve-edk2-firmware: 2.20191127-1
pve-firewall: 4.0-9
pve-firmware: 3.0-4
pve-ha-manager: 3.0-8
pve-i18n: 2.0-3
pve-qemu-kvm: 4.1.1-2
pve-xtermjs: 3.13.2-1
qemu-server: 6.1-4
smartmontools: 7.0-pve2
spiceterm: 3.1-1
vncterm: 1.6-1
zfsutils-linux: 0.8.2-pve2
root@pve:~#

Code:
root@pve:/etc/pve/lxc# pct config 104
arch: amd64
hostname: downloads
lock: mounted
memory: 1024
net0: name=eth0,bridge=vmbr0,firewall=1,gw=192.168.11.1,hwaddr=B2:0D:F9:92:9E:15,ip=192.168.11.8/24,type=veth
onboot: 0
ostype: debian
rootfs: zfs-containers:subvol-104-disk-0,size=8G
startup: order=100
swap: 512
root@pve:/etc/pve/lxc#

Code:
root@pve:~# lxc-start -n 104 -F -l DEBUG -o /tmp/lxc-104.log
lxc-start: 104: conf.c: run_buffer: 352 Script exited with status 2
lxc-start: 104: start.c: lxc_init: 897 Failed to run lxc.hook.pre-start for container "104"
lxc-start: 104: start.c: __lxc_start: 2032 Failed to initialize container "104"
Segmentation fault
root@pve:~#

Code:
root@pve:~# cat /tmp/lxc-104.log
lxc-start 104 20200103125938.277 INFO     lsm - lsm/lsm.c:lsm_init:50 - LSM security driver AppArmor
lxc-start 104 20200103125938.277 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "reject_force_umount  # comment this to allow umount -f;  not recommended"
lxc-start 104 20200103125938.277 INFO     seccomp - seccomp.c:do_resolve_add_rule:535 - Set seccomp rule to reject force umounts
lxc-start 104 20200103125938.277 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for reject_force_umount action 0(kill)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:do_resolve_add_rule:535 - Set seccomp rule to reject force umounts
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for reject_force_umount action 0(kill)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:do_resolve_add_rule:535 - Set seccomp rule to reject force umounts
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for reject_force_umount action 0(kill)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:do_resolve_add_rule:535 - Set seccomp rule to reject force umounts
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for reject_force_umount action 0(kill)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "[all]"
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "kexec_load errno 1"
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for kexec_load action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for kexec_load action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for kexec_load action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for kexec_load action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "open_by_handle_at errno 1"
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for open_by_handle_at action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for open_by_handle_at action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for open_by_handle_at action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for open_by_handle_at action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "init_module errno 1"
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for init_module action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for init_module action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for init_module action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for init_module action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "finit_module errno 1"
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for finit_module action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for finit_module action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for finit_module action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for finit_module action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "delete_module errno 1"
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for delete_module action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for delete_module action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for delete_module action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for delete_module action 327681(errno)
lxc-start 104 20200103125938.278 INFO     seccomp - seccomp.c:parse_config_v2:1008 - Merging compat seccomp contexts into main context
lxc-start 104 20200103125938.278 INFO     conf - conf.c:run_script_argv:372 - Executing script "/usr/share/lxc/hooks/lxc-pve-prestart-hook" for container "104", config section "lxc"
lxc-start 104 20200103125939.402 DEBUG    conf - conf.c:run_buffer:340 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 104 lxc pre-start produced output: unable to detect OS distribution

lxc-start 104 20200103125939.536 ERROR    conf - conf.c:run_buffer:352 - Script exited with status 2
lxc-start 104 20200103125939.537 ERROR    start - start.c:lxc_init:897 - Failed to run lxc.hook.pre-start for container "104"
lxc-start 104 20200103125939.538 ERROR    start - start.c:__lxc_start:2032 - Failed to initialize container "104"
root@pve:~#

Code:
root@pve:~# pct mount 104
mounted CT 104 in '/var/lib/lxc/104/rootfs'
root@pve:~# cat /var/lib/lxc/104/rootfs/etc/debian_version
9.11
root@pve:~#

Code:
root@pve:/etc/pve/lxc# cat /etc/pve/storage.cfg
dir: local
        path /var/lib/vz
        content iso,rootdir
        maxfiles 0
        shared 0

lvmthin: local-lvm
        thinpool data
        vgname pve
        content images,rootdir

zfspool: zfs-containers
        pool zfs-pool
        content rootdir
        sparse 0

zfspool: vm-disks
        pool zfs-pool/vm-disks
        content images
        sparse 1

dir: usb-backup
        path /mnt/usb-backup
        content backup
        maxfiles 3
        shared 0

dir: zfs-iso
        path /zfs-pool/iso
        content iso,vztmpl
        shared 0

root@pve:/etc/pve/lxc#

Any input greatly appreciated !!
 
hi,

firstly i'd like to thank you for providing all this information while asking the question :) it should be taken as an example

Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 104 lxc pre-start produced output: unable to detect OS distribution

probably your zfs subvol isn't/wasn't mounted during the start. otherwise the log looks normal. is your zfs mounted?

lock: mounted

was this already there, or did the lock appear after you did pct mount?

since you can mount the container manually, i guess lxc is having some trouble mounting it.
 
i'd like to thank you for providing all this information
Thank you for thanking :p ... aka thankception.

is your zfs mounted?
Yes, it certainly was. Because I was able to cat /zfs-pool/subvol-104-disk-0/etc/debian_version. That would otherwise have thrown an error methinks?

did the lock appear after you did pct mount?
I can not be 100% certain, I think it appeared after. Because I did cp /etc/pve/lxc/104.conf /etc/pve/lxc/104.conf.bak at the beginning of all this, and the copy does not show anything about the lock...unsure if the lock would appear in the conf file anyway ?

So searching through the docs ( wiki Locks ), i tried pct unlock 104.
The damn thing started after this.

Now, I don't even ...

edited : etv ---> etc
 
glad your problem disappeared.

probably the lock was holding it from start... but pct would have reported that, and i think containers are still supposed to start even with a mount lock. (pct start ignores the mount lock)

if you reproduce this again, please let me know.
 
  • Like
Reactions: Tommmii

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!