Open Sponge-Bas opened 3 weeks ago
Thanks for the bug report.
How is the hostname being passed to cloud-init? It it using the set hostname module, NoCloud configuration, or from a local config or cloud?
I'm asking because while cloud-init can certainly be more defensive, the input to cloud-init should really be a string.
set_hostname
is listed under cloud_init_modules
in /etc/cloud/cloud.cfg
, if that answers the question.
I have not done any manual config around cloud-init. This is just stock Ubuntu 22.04.
set_hostname is listed under cloud_init_modules in /etc/cloud/cloud.cfg, if that answers the question.
I have not done any manual config around cloud-init. This is just stock Ubuntu 22.04.
@Sponge-Bas Above you said When the hostname is an integer
. How did you set this? Please include full logs.
I edited /etc/hostname
and did a reboot. I won't include logs as I don't have time to verify they don't contain sensitive information. The provided reproducer should be sufficient.
I could not reproduce using the provided instructions.
# hostname
1
# cat /etc/hostname
12
# reboot -h now
# grep -i traceback /var/log/cloud-init.log
# hostname
12
Please include more information in your report.
Bug report
When the hostname is an integer, cloud init fails in cloudinit/util.py line 1268:
cfg["hostname"]
has the hostname parsed as an integer, but it should be parsed as a string.Steps to reproduce the problem
1) Change your hostname to an integer, e.g. 12. 2) Reboot.
Environment details
/usr/bin/cloud-init 24.1.3-0ubuntu1~22.04.5
cloud-init logs