Failed to run lxc.hook.pre-start for container

ballistikg

Member
Aug 7, 2021
3
0
6
40
I'm having issues understanding what is causing my container to fail on start. I am running PVE7.1 and have the container config below (nano /etc/pve/lxc/201.conf)

Code:
arch: amd64
cores: 4
features: mount=nfs;cifs,nesting=1
hostname: jarvis.plex
memory: 4096
mp0: /mnt/pve/qnap.media.smb,mp=/mnt/plex
net0: name=eth0,bridge=vmbr0,firewall=1,gw=10.10.100.1,hwaddr=EE:11:23:26:BF:31,ip=10.10.100.201/24,type=veth
ostype: ubuntu
rootfs: qnap.proxmox.smb:201/vm-201-disk-0.raw,size=12G
swap: 512
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.cgroup2.devices.allow: c 29:0 rwm
lxc.autodev: 1
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file
lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file

Running a log on container start produces this:
Code:
root@pve:/usr/share/lxc/hooks# lxc-start -n 201 -F -lDEBUG -o lxc-201.log
lxc-start: 201: conf.c: run_buffer: 321 Script exited with status 255
lxc-start: 201: start.c: lxc_init: 846 Failed to run lxc.hook.pre-start for container "201"
lxc-start: 201: start.c: __lxc_start: 2002 Failed to initialize container "201"
lxc-start: 201: conf.c: run_buffer: 321 Script exited with status 1
lxc-start: 201: start.c: lxc_end: 987 Failed to run lxc.hook.post-stop for container "201"
lxc-start: 201: tools/lxc_start.c: main: 306 The container failed to start
lxc-start: 201: tools/lxc_start.c: main: 311 Additional information can be obtained by setting the --logfile and --logpriority options
root@pve:/usr/share/lxc/hooks# cat lxc-201.log
lxc-start 201 20220107190904.472 INFO     lsm - lsm/lsm.c:lsm_init_static:38 - Initialized LSM security driver AppArmor
lxc-start 201 20220107190904.472 INFO     conf - conf.c:run_script_argv:337 - Executing script "/usr/share/lxc/hooks/lxc-pve-prestart-hook" for container "201", config section "lxc"
lxc-start 201 20220107190950.331 DEBUG    conf - conf.c:run_buffer:310 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 201 lxc pre-start produced output: mount: /var/lib/lxc/.pve-staged-mounts/rootfs: can't read superblock on /dev/loop2.

lxc-start 201 20220107190950.355 DEBUG    conf - conf.c:run_buffer:310 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 201 lxc pre-start produced output: command 'mount /dev/loop2 /var/lib/lxc/.pve-staged-mounts/rootfs' failed: exit code 32

lxc-start 201 20220107190950.364 ERROR    conf - conf.c:run_buffer:321 - Script exited with status 255
lxc-start 201 20220107190950.364 ERROR    start - start.c:lxc_init:846 - Failed to run lxc.hook.pre-start for container "201"
lxc-start 201 20220107190950.364 ERROR    start - start.c:__lxc_start:2002 - Failed to initialize container "201"
lxc-start 201 20220107190950.364 INFO     conf - conf.c:run_script_argv:337 - Executing script "/usr/share/lxc/hooks/lxc-pve-poststop-hook" for container "201", config section "lxc"
lxc-start 201 20220107190950.804 DEBUG    conf - conf.c:run_buffer:310 - Script exec /usr/share/lxc/hooks/lxc-pve-poststop-hook 201 lxc post-stop produced output: umount: /var/lib/lxc/201/rootfs: not mounted

lxc-start 201 20220107190950.804 DEBUG    conf - conf.c:run_buffer:310 - Script exec /usr/share/lxc/hooks/lxc-pve-poststop-hook 201 lxc post-stop produced output: command 'umount --recursive -- /var/lib/lxc/201/rootfs' failed: exit code 1

lxc-start 201 20220107190950.813 ERROR    conf - conf.c:run_buffer:321 - Script exited with status 1
lxc-start 201 20220107190950.813 ERROR    start - start.c:lxc_end:987 - Failed to run lxc.hook.post-stop for container "201"
lxc-start 201 20220107190950.813 ERROR    lxc_start - tools/lxc_start.c:main:306 - The container failed to start
lxc-start 201 20220107190950.813 ERROR    lxc_start - tools/lxc_start.c:main:311 - Additional information can be obtained by setting the --logfile and --logpriority options

I appreciate anyone's assistance on this in advance - Steve
 
hi,

either the container disk is damaged or doesn't exist, or maybe your storage is full?

can you post the output of:

Code:
lsblk -f
lvs -a
vgs -a
 
  • Like
Reactions: ballistikg
Code:
root@pve:~# lsblk -f
NAME         FSTYPE      FSVER    LABEL UUID                                   FSAVAIL FSUSE% MOUNTPOINT
loop0        ext4        1.0            6a8c6e37-cef8-4a4a-baeb-52c481537caa                 
nvme0n1                                                                                       
├─nvme0n1p1                                                                                   
├─nvme0n1p2  vfat        FAT32          8AF0-D38A                                             
└─nvme0n1p3  LVM2_member LVM2 001       gndkBs-4cms-9Gsu-telW-2765-xKDF-wN7IwD               
  ├─pve-swap swap        1              cb02ed1d-73de-429d-9971-fb9cd47335ef                  [SWAP]
  └─pve-root ext4        1.0            790c7330-2ae6-4a3b-add4-1ab364dea610    385.9G    11% /
root@pve:~# lvs -a
  LV   VG  Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root pve -wi-ao---- <457.26g                                                   
  swap pve -wi-ao----    8.00g                                                   
root@pve:~# vgs -a
  VG  #PV #LV #SN Attr   VSize    VFree
  pve   1   2   0 wz--n- <465.26g    0
 
okay it seems like you do have enough space, in that case i'd look at this:
Code:
rootfs: qnap.proxmox.smb:201/vm-201-disk-0.raw,size=12G
your container disk being hosted on shared storage, maybe you can try to move the disk locally and see if that fixes your issue (if it does, then likely it's a problem with the network share)
 
The problem seems to be occurring when I move a local disk to remote and then try and start the LXC? Any idea why this would be the case?
 

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!