[SOLVED] lxc pre-start produced output: unable to detect OS distribution

RobFantini

Famous Member
May 24, 2012
2,043
111
133
Boston,Mass
Hello,
I have a debian etch openvz dump that i've restored to a lxc.

the lxc will not start.

debug mode log shows
Code:
lxc-start 121 20191222152239.443 DEBUG    conf - conf.c:run_buffer:340 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 121 lxc pre-start produced output: unable to detect OS distribution



any ideas it get this running?
 
Last edited:
this shows at dmesg each time the lxc is attempted to start :
Code:
[Mon Dec 23 04:45:33 2019] EXT4-fs (loop0): mounted filesystem with ordered data mode. Opts: (null)
[Mon Dec 23 04:45:33 2019] lxc-start[2086595]: segfault at 50 ip 00007f14f406ef8b sp 00007fffa3588ba0 error 4 in liblxc.so.1.6.0[7f14f4015000+8a000]
[Mon Dec 23 04:45:33 2019] Code: 9b c0 ff ff 4d 85 ff 0f 85 82 02 00 00 66 90 48 8b 73 50 48 8b bb f8 00 00 00 e8 80 78 fa ff 4c 8b 74 24 10 48 89 de 4c 89 f7 <41> ff 56 50 4c 89 f7 48 89 de 41 ff 56 58 48 8b 83 f8 00 00 00 8b
 
please post the config-file of the container
did you configure it to be marked as a debian-container? i.e. does the config contain the line:
Code:
ostype: debian
 
Code:
arch: i386
cpulimit: 2
cpuunits: 1024
hostname: localhost.yyy.com
memory: 1024
net0: name=eth0,bridge=vmbr0,firewall=1,gw=10.1.7.1,hwaddr=5A:66:BA:81:C9:F3,ip=10.1.7.7/24,tag=7,type=veth
ostype: debian
rootfs: nvme-ext4:121/vm-121-disk-0.raw,size=14G
swap: 1536
 
Last edited:
Does the container have a '/etc/debian_version' file? (and what are its contents?)
 
ok - I tried to reproduce this here locally - albeit with a centos 6 container (the only template still using i386 as architecture I found):
* starting the container using `pct start $VMID` works here
* starting the container in foreground with debug-logging also causes a segfault in 'lxc-start segfault at 50'
(which is AFAICT the reason for the unable to detect os distribution (since I'm getting this here as well))

However it works if I start the container with logging to DEBUG, but not in foreground:
lxc-start -n VMID -l DEBUG -o /tmp/lxc-ID.log

please post the contents of /tmp/lxc-ID.log (please remove it before running the command)

if this does not help also post the contents of: '/var/lib/lxc/VMID/config
 
ok - I tried to reproduce this here locally - albeit with a centos 6 container (the only template still using i386 as architecture I found):
* starting the container using `pct start $VMID` works here
* starting the container in foreground with debug-logging also causes a segfault in 'lxc-start segfault at 50'
(which is AFAICT the reason for the unable to detect os distribution (since I'm getting this here as well))

However it works if I start the container with logging to DEBUG, but not in foreground:
lxc-start -n VMID -l DEBUG -o /tmp/lxc-ID.log

please post the contents of /tmp/lxc-ID.log (please remove it before running the command)

if this does not help also post the contents of: '/var/lib/lxc/VMID/config

Code:
# lxc-start -n 121  -l DEBUG -o /tmp/lxc-ID.log
lxc-start: 121: lxccontainer.c: wait_on_daemonized_start: 865 No such file or directory - Failed to receive the container state
lxc-start: 121: tools/lxc_start.c: main: 329 The container failed to start
lxc-start: 121: tools/lxc_start.c: main: 332 To get more details, run the container in foreground mode
lxc-start: 121: tools/lxc_start.c: main: 335 Additional information can be obtained by setting the --logfile and --logpriority options

log:
Code:
lxc-start 121 20191223161500.929 INFO     lxccontainer - lxccontainer.c:do_lxcapi_start:994 - Set process title to [lxc monitor] /var/lib/lxc 121
lxc-start 121 20191223161500.929 INFO     lsm - lsm/lsm.c:lsm_init:50 - LSM security driver AppArmor
lxc-start 121 20191223161500.929 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "reject_force_umount  # comment this to allow umount -f;  not recommended"
lxc-start 121 20191223161500.929 INFO     seccomp - seccomp.c:do_resolve_add_rule:535 - Set seccomp rule to reject force umounts
lxc-start 121 20191223161500.929 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for reject_force_umount action 0(kill)
lxc-start 121 20191223161500.929 INFO     seccomp - seccomp.c:do_resolve_add_rule:535 - Set seccomp rule to reject force umounts
lxc-start 121 20191223161500.929 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for reject_force_umount action 0(kill)
lxc-start 121 20191223161500.929 INFO     seccomp - seccomp.c:do_resolve_add_rule:535 - Set seccomp rule to reject force umounts
lxc-start 121 20191223161500.929 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for reject_force_umount action 0(kill)
lxc-start 121 20191223161500.929 INFO     seccomp - seccomp.c:do_resolve_add_rule:535 - Set seccomp rule to reject force umounts
lxc-start 121 20191223161500.929 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for reject_force_umount action 0(kill)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "[all]"
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "kexec_load errno 1"
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for kexec_load action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for kexec_load action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for kexec_load action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for kexec_load action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "open_by_handle_at errno 1"
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for open_by_handle_at action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for open_by_handle_at action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for open_by_handle_at action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for open_by_handle_at action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "init_module errno 1"
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for init_module action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for init_module action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for init_module action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for init_module action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "finit_module errno 1"
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for finit_module action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for finit_module action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for finit_module action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for finit_module action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:789 - Processing "delete_module errno 1"
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:975 - Added native rule for arch 0 for delete_module action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:984 - Added compat rule for arch 1073741827 for delete_module action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:994 - Added compat rule for arch 1073741886 for delete_module action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:1004 - Added native rule for arch -1073741762 for delete_module action 327681(errno)
lxc-start 121 20191223161500.930 INFO     seccomp - seccomp.c:parse_config_v2:1008 - Merging compat seccomp contexts into main context
lxc-start 121 20191223161500.930 INFO     conf - conf.c:run_script_argv:372 - Executing script "/usr/share/lxc/hooks/lxc-pve-prestart-hook" for container "121", config section "lxc"
lxc-start 121 20191223161501.364 DEBUG    conf - conf.c:run_buffer:340 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 121 lxc pre-start produced output: file '/etc/hosts' too long - aborting

lxc-start 121 20191223161501.365 DEBUG    conf - conf.c:run_buffer:340 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 121 lxc pre-start produced output: error in setup task PVE::LXC::Setup::pre_start_hook

lxc-start 121 20191223161501.373 ERROR    conf - conf.c:run_buffer:352 - Script exited with status 1
lxc-start 121 20191223161501.373 ERROR    start - start.c:lxc_init:897 - Failed to run lxc.hook.pre-start for container "121"
lxc-start 121 20191223161501.373 ERROR    start - start.c:__lxc_start:2032 - Failed to initialize container "121"
lxc-start 121 20191223161501.401 DEBUG    lxccontainer - lxccontainer.c:wait_on_daemonized_start:862 - First child 2757189 exited
lxc-start 121 20191223161501.401 ERROR    lxccontainer - lxccontainer.c:wait_on_daemonized_start:865 - No such file or directory - Failed to receive the container state
lxc-start 121 20191223161501.401 ERROR    lxc_start - tools/lxc_start.c:main:329 - The container failed to start
lxc-start 121 20191223161501.401 ERROR    lxc_start - tools/lxc_start.c:main:332 - To get more details, run the container in foreground mode
lxc-start 121 20191223161501.402 ERROR    lxc_start - tools/lxc_start.c:main:335 - Additional information can be obtained by setting the --logfile and --logpriority options