[SOLVED] Issue with Debian12 cloud image and cloud-init
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So I have setup few distros that utilise NoCloud cloud-init to set things such as default user activation upon first boot. Nothing fancy.
Distros such as Ubuntu 23.04 and 24.x, Alpine and Fedora 39 worked as expected.
Debian12-genericcloud (and openSUSE-15.5 )on the other hand had trouble activating default user 'debian'. Checking the logs, it appears it had trouble running the module ssh-authkey-fingerprints
I can understand that openSUSE might have this issue because its cloud-init version is quite ancient, but debian's pretty recent.
Code:
2024-04-20 00:32:21,125 - modules.py[DEBUG]: Running module ssh-authkey-fingerprints (<module 'cloudinit.config.cc_ssh_authkey_fingerprints' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_ssh_authkey_fingerprints.py'>) with frequency once-per-instance
2024-04-20 00:32:21,125 - handlers.py[DEBUG]: start: modules-final/config-ssh-authkey-fingerprints: running config-ssh-authkey-fingerprints with frequency once-per-instance
2024-04-20 00:32:21,125 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/iid-datasource-none/sem/config_ssh_authkey_fingerprints - wb: [644] 24 bytes
2024-04-20 00:32:21,125 - helpers.py[DEBUG]: Running config-ssh-authkey-fingerprints using lock (<FileLock using file '/var/lib/cloud/instances/iid-datasource-none/sem/config_ssh_authkey_fingerprints'>)
2024-04-20 00:32:21,126 - handlers.py[DEBUG]: finish: modules-final/config-ssh-authkey-fingerprints: FAIL: running config-ssh-authkey-fingerprints with frequency once-per-instance
2024-04-20 00:32:21,126 - util.py[WARNING]: Running module ssh-authkey-fingerprints (<module 'cloudinit.config.cc_ssh_authkey_fingerprints' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_ssh_authkey_fingerprints.py'>) failed
2024-04-20 00:32:21,127 - util.py[DEBUG]: Running module ssh-authkey-fingerprints (<module 'cloudinit.config.cc_ssh_authkey_fingerprints' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_ssh_authkey_fingerprints.py'>) failed
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/cloudinit/config/modules.py", line 246, in _run_modules
ran, _r = cc.run(
^^^^^^^
File "/usr/lib/python3/dist-packages/cloudinit/cloud.py", line 67, in run
return self._runners.run(name, functor, args, freq, clear_on_fail)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/cloudinit/helpers.py", line 185, in run
results = functor(*args)
^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/cloudinit/config/cc_ssh_authkey_fingerprints.py", line 139, in handle
(key_fn, key_entries) = ssh_util.extract_authorized_keys(user_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/cloudinit/ssh_util.py", line 408, in extract_authorized_keys
(ssh_dir, pw_ent) = users_ssh_info(username)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/cloudinit/ssh_util.py", line 232, in users_ssh_info
pw_ent = pwd.getpwnam(username)
^^^^^^^^^^^^^^^^^^^^^^
KeyError: "getpwnam(): name not found: 'debian'"
2024-04-20 00:32:21,150 - modules.py[DEBUG]: Running module keys-to-console (<module 'cloudinit.config.cc_keys_to_console' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_keys_to_console.py'>) with frequency once-per-instance
2024-04-20 00:32:21,150 - handlers.py[DEBUG]: start: modules-final/config-keys-to-console: running config-keys-to-console with frequency once-per-instance
2024-04-20 00:32:21,151 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/iid-datasource-none/sem/config_keys_to_console - wb: [644] 24 bytes
2024-04-20 00:32:21,152 - helpers.py[DEBUG]: Running config-keys-to-console using lock (<FileLock using file '/var/lib/cloud/instances/iid-datasource-none/sem/config_keys_to_console'>)
2024-04-20 00:32:21,152 - subp.py[DEBUG]: Running command ['/usr/lib/cloud-init/write-ssh-key-fingerprints', '', 'ssh-dss'] with allowed return codes [0] (shell=False, capture=True)
2024-04-20 00:32:21,157 - handlers.py[DEBUG]: finish: modules-final/config-keys-to-console: SUCCESS: config-keys-to-console ran successfully
2024-04-20 00:32:21,157 - modules.py[DEBUG]: Running module install-hotplug (<module 'cloudinit.config.cc_install_hotplug' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_install_hotplug.py'>) with frequency once-per-instance
2024-04-20 00:32:21,157 - handlers.py[DEBUG]: start: modules-final/config-install-hotplug: running config-install-hotplug with frequency once-per-instance
2024-04-20 00:32:21,158 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/iid-datasource-none/sem/config_install_hotplug - wb: [644] 24 bytes
2024-04-20 00:32:21,159 - helpers.py[DEBUG]: Running config-install-hotplug using lock (<FileLock using file '/var/lib/cloud/instances/iid-datasource-none/sem/config_install_hotplug'>)
2024-04-20 00:32:21,161 - stages.py[DEBUG]: Allowed events: {<EventScope.NETWORK: 'network'>: {<EventType.BOOT_NEW_INSTANCE: 'boot-new-instance'>}}
2024-04-20 00:32:21,162 - stages.py[DEBUG]: Event Denied: scopes=['network'] EventType=hotplug
2024-04-20 00:32:21,163 - cc_install_hotplug.py[DEBUG]: Skipping hotplug install, not enabled
2024-04-20 00:32:21,163 - handlers.py[DEBUG]: finish: modules-final/config-install-hotplug: SUCCESS: config-install-hotplug ran successfully
2024-04-20 00:32:21,164 - modules.py[DEBUG]: Running module final-message (<module 'cloudinit.config.cc_final_message' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_final_message.py'>) with frequency always
2024-04-20 00:32:21,164 - handlers.py[DEBUG]: start: modules-final/config-final-message: running config-final-message with frequency always
2024-04-20 00:32:21,164 - helpers.py[DEBUG]: Running config-final-message using lock (<cloudinit.helpers.DummyLock object at 0x7f32f4ab3010>)
2024-04-20 00:32:21,164 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2024-04-20 00:32:21,165 - util.py[DEBUG]: Read 12 bytes from /proc/uptime
2024-04-20 00:32:21,176 - util.py[DEBUG]: Cloud-init v. 22.4.2 finished at Sat, 20 Apr 2024 00:32:21 +0000. Datasource DataSourceNone. Up 16.66 seconds
2024-04-20 00:32:21,176 - util.py[DEBUG]: Writing to /var/lib/cloud/instance/boot-finished - wb: [644] 52 bytes
2024-04-20 00:32:21,177 - util.py[WARNING]: Failed to write boot finished file /var/lib/cloud/instance/boot-finished
2024-04-20 00:32:21,177 - util.py[DEBUG]: Failed to write boot finished file /var/lib/cloud/instance/boot-finished
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/cloudinit/config/cc_final_message.py", line 106, in handle
util.write_file(boot_fin_fn, contents, ensure_dir_exists=False)
File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 2172, in write_file
with open(filename, omode) as fh:
^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/cloud/instance/boot-finished'
2024-04-20 00:32:21,202 - cc_final_message.py[WARNING]: Used fallback datasource
2024-04-20 00:32:21,203 - handlers.py[DEBUG]: finish: modules-final/config-final-message: SUCCESS: config-final-message ran successfully
2024-04-20 00:32:21,203 - main.py[DEBUG]: Ran 12 modules with 1 failures
2024-04-20 00:32:21,205 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/status.json (via temporary file /var/lib/cloud/data/tmpbwlugrgq) - w: [644] 647 bytes/chars
2024-04-20 00:32:21,211 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/result.json (via temporary file /var/lib/cloud/data/tmpj3sadadd) - w: [644] 142 bytes/chars
2024-04-20 00:32:21,212 - util.py[DEBUG]: Creating symbolic link from '/run/cloud-init/result.json' => '../../var/lib/cloud/data/result.json'
2024-04-20 00:32:21,212 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2024-04-20 00:32:21,212 - util.py[DEBUG]: Read 12 bytes from /proc/uptime
2024-04-20 00:32:21,212 - util.py[DEBUG]: cloud-init mode 'modules' took 0.254 seconds (0.26)
2024-04-20 00:32:21,213 - handlers.py[DEBUG]: finish: modules-final: FAIL: running modules for final
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.