[Bug 2013403] Re: lunar riscv64 preinstalled image shows login prompt before login is possible

Brett Holman 2013403 at bugs.launchpad.net
Fri Mar 31 19:18:16 UTC 2023


This sounds like possibly something should be waiting on cloud-init and
isn't?

I reproduced this error with the following:

qemu-system-riscv64 \
    -machine virt \
    -cpu rv64 \
    -m 1G \
    -device virtio-blk-device,drive=hd \
    -drive file=lunar-preinstalled-server-riscv64+unmatched.img,if=none,id=hd \
    -device virtio-net-device,netdev=net \
    -netdev user,id=net,hostfwd=tcp::2222-:22 \
    -bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf \
    -kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \
    -object rng-random,filename=/dev/urandom,id=rng \
    -device virtio-rng-device,rng=rng \
    -append "root=LABEL=rootfs console=ttyS0" \                                         
    -nographic

Log:

[  OK  ] Created slice system-getty.slice - Slice /system/getty.
[  OK  ] Started getty at tty1.service - Getty on tty1.
[  OK  ] Reached target getty.target - Login Prompts.
[  OK  ] Started systemd-logind.service - User Login Management.
[  OK  ] Started unattended-upgrade…0m - Unattended Upgrades Shutdown.

Ubuntu Lunar Lobster (development branch) ubuntu ttyS0

ubuntu login: ubuntu
Password: 

Login incorrect
ubuntu login: [  148.735449] Dev loop3: unable to read RDB block 8
[  166.631180] cloud-init[715]: Cloud-init v. 23.1.1-0ubuntu2 running 'modules:config' at Fri, 31 Mar 2023 18:48:02 +0000. Up 165.88 seconds.
[  167.335569] cloud-init[715]: 2023-03-31 18:48:03,547 - cc_set_passwords.py[WARNING]: DEPRECATION: key 'lists' is now deprecated. Use 'users'.
[  177.934571] cloud-init[751]: Cloud-init v. 23.1.1-0ubuntu2 running 'modules:final' at Fri, 31 Mar 2023 18:48:13 +0000. Up 177.29 seconds.
ci-info: no authorized SSH keys fingerprints found for user ubuntu.
<14>Mar 31 18:48:15 cloud-init: #############################################################
<14>Mar 31 18:48:15 cloud-init: -----BEGIN SSH HOST KEY FINGERPRINTS-----
<14>Mar 31 18:48:15 cloud-init: 1024 SHA256:szpuJaLNqHJR/i5rtmAW0QBDc4rOiZkbzg0oJr+5x2g root at ubuntu (DSA)
<14>Mar 31 18:48:15 cloud-init: 256 SHA256:c7UTAof0IjqZWPy43dgZmqxdo4ajOcWCsAwt7W/EoOY root at ubuntu (ECDSA)
<14>Mar 31 18:48:16 cloud-init: 256 SHA256:ZCyPk622f7s3RgJdgB5ps5X00BMA5/8wUfM8L3sgZDY root at ubuntu (ED25519)
<14>Mar 31 18:48:16 cloud-init: 3072 SHA256:MrkVMol0wlpj6LM2LQvW5wsZbOrP4BXv5V2m8p5+u1A root at ubuntu (RSA)
<14>Mar 31 18:48:16 cloud-init: -----END SSH HOST KEY FINGERPRINTS-----
<14>Mar 31 18:48:16 cloud-init: #############################################################
-----BEGIN SSH HOST KEY KEYS-----
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBIuN1I/bvbih1NnNZ7kNBBEbZBDjQ/yLwB+S+iLJIbR3n70G8VHsPNP7B9DQmA/DGaC6kTL78i1pLp17EggzjNI= root at ubuntu
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDjt0gd0c3qEw7HrZfWFFpWlh0Folwu2Wh1vR9xmkxEh root at ubuntu
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCJcFHCuEnviGbmy/Q33WgKlC71YaNM88of/mJh7FY/edNMjjF6va1oB0QLRuZQ3OTWFcujOCej3mdqwcF6R/SjKRnzXsmvPRJv+KE4dgMU0PVKWeHM5fu4QChHskVMF6j8FHq+RbPV5iytKQCQ3BA6I1WkV4Y6MVXlGN+jMoeKPENEBmhA8t1yPZBH6yeq2Aq9UuuLYjZhiO3mm05HaXqzwKDP8TRU1MBMsyOhoVmcgiQ7uH3wY00mu11/xGgKo7lSPVV3C1v7gME6ROX2zRLklMOWDt7wehvSEae7NJ8CcihJxczrUhw30/mbNoPS7BHw8Lbq4kffRHwznX4j8YKZrke0QIOFqTguIw90x2GaDmaY5iw/TZEyav/gvl0SicAwXNrdOgtY98OgZL5ddtESsd6ZHX1CY/HkPAlaWooroKh8l5V+kW+ioYHhG/nDV5nPLa76XlxkA+VjQnKtS2tk+ZJuR/rVca9ATs9MgQ5sg156ofl2rGiQHERg5kQN0BU= root at ubuntu
-----END SSH HOST KEY KEYS-----
[  180.509275] cloud-init[751]: Cloud-init v. 23.1.1-0ubuntu2 finished at Fri, 31 Mar 2023 18:48:16 +0000. Datasource DataSourceNoCloud [seed=/var/lib/cloud/seed/nocloud-net][dsmode=net].  Up 180.41 seconds
ubuntu
Password: 
You are required to change your password immediately (administrator enforced).
Changing password for ubuntu.
Current password: 

ubuntu at ubuntu:~$ lscpu
Architecture:          riscv64
  Byte Order:          Little Endian
CPU(s):                1
  On-line CPU(s) list: 0
NUMA:                  
  NUMA node(s):        1
  NUMA node0 CPU(s):   0

Unrelated to this issue I see that the userdata config shipped with the
image is using a deprecated format:

ubuntu at ubuntu:~$ sudo cloud-init query userdata
#cloud-config
chpasswd:
    expire: True
    list:
        - ubuntu:ubuntu
ssh_pwauth: True

These days, the more structured `users` key is preferred over `list`, so
the shipped config might look something like this:

#cloud-config
chpasswd:
    expire: True
    users:
        - name: ubuntu
          password: ubuntu
          type: text
ssh_pwauth: True



** Changed in: cloud-init (Ubuntu)
       Status: New => Triaged

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to livecd-rootfs in Ubuntu.
https://bugs.launchpad.net/bugs/2013403

Title:
  lunar riscv64 preinstalled image shows login prompt before login is
  possible

Status in cloud-init package in Ubuntu:
  Triaged
Status in livecd-rootfs package in Ubuntu:
  New

Bug description:
  Testing the lunar unmatched daily image in qemu, I was given a login
  prompt on console and tried to log in, and it repeatedly failed.

  This is because cloud-init had not finished running, so the user that
  was provisioned via nocloud data was not actually available.

  There should not be a race.  The login prompt should not be shown
  until after the user exists - either by changing the ordering of the
  systemd units, or by not using cloud-init to configure the initial
  user.  (I don't see any obvious reason that a hard-coded initial
  user/password should be done via cloud-init instead of being
  prepopulated in /etc/passwd, but feel free to enlighten me.)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/2013403/+subscriptions




More information about the foundations-bugs mailing list