What would cause cloudinit to hang on startup?

March 2, 2019 1.7k views
DigitalOcean Initial Server Setup

I’ve got an Ubuntu 18 droplet that hangs indefinitely at some point during the boot process on cloudinit. When I reboot it, I have to connect to the console and press ctrl-c to allow a normal boot to continue.

systemd-analyze blame confirms that cloud-init-local.service is active when this hang occurs:

9h 58min 6.762s cloud-init-local.service

However, /var/log/cloud-init.log makes it look as if the system was doing something else before cloudinit was started (note the uptime):

2019-03-02 17:10:48,269 - util.py[DEBUG]: Cloud-init v. 18.4-0ubuntu1~18.04.1 running 'init-local' at Sat, 02 Mar 2019 17:10:48 +0000. Up 35890.58 seconds.

This is also confirmed by the journal:

Mar 02 02:12:42 isengard systemd-udevd[728]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Mar 02 02:12:42 isengard systemd[1]: Found device Virtio network device.
Mar 02 02:12:42 isengard systemd[1]: Found device Virtio network device.
Mar 02 12:10:48 isengard kernel: random: nonblocking pool is initialized
Mar 02 12:10:48 isengard cloud-init[696]: Cloud-init v. 18.4-0ubuntu1~18.04.1 running 'init-local' at Sat, 02 Mar 2019 17:10:48 +0000. Up 35890.58 seconds.
Mar 02 12:10:48 isengard systemd[1]: Started Initial cloud-init job (pre-networking).

Is there a way to increase the verbosity of both the boot process and cloudinit so I can find where this hang is located?

1 Answer

Hey friend,

Great question, thank you for posting it here. I’m not sure there’s more to be had in terms of logging on those items, but I’ve been hitting my head against the desk to drum up some ideas on this. My first thought is roll back the kernel, assuming you have the previous version installed still, and see if it still occurs. This is usually my first move for boot issues, just to narrow the scope. Aside from that, there are some good tips here for locating the cause of boot issues:

https://www.tecmint.com/find-and-fix-linux-boot-issues/

It’s stuff you already know, but maybe there’s something you forgot to look at that can tell more about it. It seems unlikely that it would occur without having been logged under normal circumstances. A reference never hurts.

Jarland

Have another answer? Share your knowledge.