lxc vm startup fails in lxc-pve-prestart-hook

Hans L

Active Member
Jul 7, 2018
4
0
41
53
Hello,

While evaluating pve 5.2 on a server I ran into an lxc vm that refused to start. The error I was able to retrieve mentioned this:

lxc-start 101 20180706154548.805 INFO lxc_conf - conf.c:run_script_argv:368 - Executing script "/usr/share/lxc/hooks/lxc-pve-prestart-hook" for container "101", config section "lxc"
lxc-start 101 20180706154549.606 DEBUG lxc_conf - conf.c:run_buffer:338 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 101 lxc pre-start with output: file '/etc/hosts' too long - aborting
lxc-start 101 20180706154549.607 DEBUG lxc_conf - conf.c:run_buffer:338 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 101 lxc pre-start with output: error in setup task PVE::LXC::Setup::pre_start_hook
lxc-start 101 20180706154549.614 ERROR lxc_conf - conf.c:run_buffer:347 - Script exited with status 1
lxc-start 101 20180706154549.614 ERROR lxc_start - start.c:lxc_init:815 - Failed to run lxc.hook.pre-start for container "101"
lxc-start 101 20180706154549.614 ERROR lxc_start - start.c:__lxc_start:1849 - Failed to initialize container "101"


And I do have to admit this vm operates with an /etc/hosts that is rather large (57kb). But it would be nice to be able to run those vm's in all of pve's goodness instead of a plain, bare debian lxc server.

Regards and thx,
Hans
 
Hello Stoiko,

That seems like an excellent solution of this problem. I totally overlooked the part in de docs about touching /etc/.pve-ignore.hosts.

I owe you a beverage of your choice.

Regards,
Hans



Hi,

The current limit seems to be 32kb for /etc/hosts.

You can disable pve touching /etc/hosts for a particular container completely as described in the docs:
https://pve.proxmox.com/wiki/Linux_Container

Does this solve your problem?
 
Hello Stoiko,

it was a great suggestion to try touching /etc/.pve-ignore.hosts, but unfortunately it does not seem to have the effect I was hoping on. The error I get still says:

lxc-start 101 20180712160306.504 INFO lxc_conf - conf.c:run_script_argv:368 - Executing script "/usr/share/lxc/hooks/lxc-pve-prestart-hook" for container "101", config section "lxc"
lxc-start 101 20180712160307.821 DEBUG lxc_conf - conf.c:run_buffer:338 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 101 lxc pre-start with output: file '/etc/hosts' too long - aborting

The only workaround is (obviously) move the bigger /etc/hosts in place AFTER the container was started, but that is rather clumsy.

Thx,
Hans

Hi,

The current limit seems to be 32kb for /etc/hosts.

You can disable pve touching /etc/hosts for a particular container completely as described in the docs:
https://pve.proxmox.com/wiki/Linux_Container

Does this solve your problem?
 
Hah! so I guess a 24M hosts file is way too big.
Why you ask?????

Using dnsmasq as a add dump dns server. It reads and uses the local hosts file. Works great!

First reboot of the server (vm) since the initial install several weeks ago... ran into this.
At any rate, this solution here https://bugzilla.proxmox.com/ worked great.
 

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!