New Ubuntu Core installation with constant service restarts

Just installed 3 Ubuntu Core images for testing on amd64 hardware. All images have the following sample repeated output on journalctl.

Jun 07 14:07:35 dedicado01 systemd[1]: Started Ubuntu Core Firstboot Configuration ttyS0.
Jun 07 14:07:35 dedicado01 systemd[1]: Stopping Serial Getty on ttyS0...
Jun 07 14:07:35 dedicado01 systemd[1]: serial-getty@ttyS0.service: Deactivated successfully.
Jun 07 14:07:35 dedicado01 systemd[1]: Stopped Serial Getty on ttyS0.
Jun 07 14:07:35 dedicado01 console-conf-write-login-details[25510]: i18n file is /usr/share/subiquity/subiquitycore/i18n.py
Jun 07 14:07:35 dedicado01 console-conf-write-login-details[25510]: Final localedir is /usr/share/locale
Jun 07 14:07:35 dedicado01 console-conf-write-login-details[25510]: switch_language en_US
Jun 07 14:07:35 dedicado01 systemd[1]: Started Getty on tty1.
Jun 07 14:07:35 dedicado01 systemd[1]: console-conf@tty1.service: Deactivated successfully.
Jun 07 14:07:35 dedicado01 systemd[1]: console-conf@tty1.service: Scheduled restart job, restart counter is at 429.
Jun 07 14:07:35 dedicado01 systemd[1]: Stopped Ubuntu Core Firstboot Configuration tty1.
Jun 07 14:07:35 dedicado01 systemd[1]: Started Ubuntu Core Firstboot Configuration tty1.
Jun 07 14:07:35 dedicado01 systemd[1]: Stopping Getty on tty1...
Jun 07 14:07:35 dedicado01 systemd[1]: getty@tty1.service: Deactivated successfully.
Jun 07 14:07:35 dedicado01 systemd[1]: Stopped Getty on tty1.
Jun 07 14:07:35 dedicado01 console-conf-write-login-details[25537]: i18n file is /usr/share/subiquity/subiquitycore/i18n.py
Jun 07 14:07:35 dedicado01 console-conf-write-login-details[25537]: Final localedir is /usr/share/locale
Jun 07 14:07:35 dedicado01 console-conf-write-login-details[25537]: switch_language en_US
Jun 07 14:07:40 dedicado01 systemd[1]: Started Serial Getty on ttyS0.
Jun 07 14:07:40 dedicado01 systemd[1]: serial-console-conf@ttyS0.service: Deactivated successfully.
Jun 07 14:07:40 dedicado01 systemd[1]: serial-console-conf@ttyS0.service: Scheduled restart job, restart counter is at 438.
Jun 07 14:07:40 dedicado01 systemd[1]: Stopped Ubuntu Core Firstboot Configuration ttyS0.
Jun 07 14:07:40 dedicado01 systemd[1]: Started Ubuntu Core Firstboot Configuration ttyS0.
Jun 07 14:07:40 dedicado01 systemd[1]: Stopping Serial Getty on ttyS0...
Jun 07 14:07:40 dedicado01 systemd[1]: serial-getty@ttyS0.service: Deactivated successfully.
Jun 07 14:07:40 dedicado01 systemd[1]: Stopped Serial Getty on ttyS0.
Jun 07 14:07:40 dedicado01 console-conf-write-login-details[25564]: i18n file is /usr/share/subiquity/subiquitycore/i18n.py
Jun 07 14:07:40 dedicado01 console-conf-write-login-details[25564]: Final localedir is /usr/share/locale
Jun 07 14:07:40 dedicado01 console-conf-write-login-details[25564]: switch_language en_US
Jun 07 14:07:41 dedicado01 systemd[1]: Started Getty on tty1.
Jun 07 14:07:41 dedicado01 systemd[1]: console-conf@tty1.service: Deactivated successfully.
Jun 07 14:07:41 dedicado01 systemd[1]: console-conf@tty1.service: Scheduled restart job, restart counter is at 430.
Jun 07 14:07:41 dedicado01 systemd[1]: Stopped Ubuntu Core Firstboot Configuration tty1.
Jun 07 14:07:41 dedicado01 systemd[1]: Started Ubuntu Core Firstboot Configuration tty1.
Jun 07 14:07:41 dedicado01 systemd[1]: Stopping Getty on tty1...
Jun 07 14:07:41 dedicado01 systemd[1]: getty@tty1.service: Deactivated successfully.
Jun 07 14:07:41 dedicado01 systemd[1]: Stopped Getty on tty1.
Jun 07 14:07:41 dedicado01 console-conf-write-login-details[25592]: i18n file is /usr/share/subiquity/subiquitycore/i18n.py
Jun 07 14:07:41 dedicado01 console-conf-write-login-details[25592]: Final localedir is /usr/share/locale
Jun 07 14:07:41 dedicado01 console-conf-write-login-details[25592]: switch_language en_US
Jun 07 14:07:45 dedicado01 systemd[1]: Started Serial Getty on ttyS0.
Jun 07 14:07:45 dedicado01 systemd[1]: serial-console-conf@ttyS0.service: Deactivated successfully.
Jun 07 14:07:45 dedicado01 systemd[1]: serial-console-conf@ttyS0.service: Scheduled restart job, restart counter is at 439.
Jun 07 14:07:45 dedicado01 systemd[1]: Stopped Ubuntu Core Firstboot Configuration ttyS0.
Jun 07 14:07:45 dedicado01 systemd[1]: Started Ubuntu Core Firstboot Configuration ttyS0.
Jun 07 14:07:45 dedicado01 systemd[1]: Stopping Serial Getty on ttyS0...
Jun 07 14:07:45 dedicado01 systemd[1]: serial-getty@ttyS0.service: Deactivated successfully.
Jun 07 14:07:45 dedicado01 systemd[1]: Stopped Serial Getty on ttyS0.
Jun 07 14:07:46 dedicado01 console-conf-write-login-details[25619]: i18n file is /usr/share/subiquity/subiquitycore/i18n.py
Jun 07 14:07:46 dedicado01 console-conf-write-login-details[25619]: Final localedir is /usr/share/locale
Jun 07 14:07:46 dedicado01 console-conf-write-login-details[25619]: switch_language en_US

Did anyone else encounter a similar issue? Can someone help me debug this?

It seems related to finding an IP address on the installation interface. Since I plan on running LXD, it’s better to set up a bridge to connect containers to. So I change netplan into the following:

network:
  version: 2

  ethernets:
    enp2s0:
      dhcp4: false

  bridges:
    br0:
      interfaces:
        - enp2s0
      addresses:
        - 10.0.0.4/24
      nameservers:
        addresses:
          - 10.0.0.1
        search: []
      routes:
        - to: default
          via: 10.0.0.1

I get the following address configuration:

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
    link/ether 5c:85:7e:4f:99:74 brd ff:ff:ff:ff:ff:ff
3: wlp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 38:fc:98:03:79:60 brd ff:ff:ff:ff:ff:ff
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 7a:76:39:28:ca:14 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.4/24 brd 10.0.0.255 scope global br0
       valid_lft forever preferred_lft forever
    inet6 fe80::7876:39ff:fe28:ca14/64 scope link 
       valid_lft forever preferred_lft forever

When I reboot, the screen output changes to

Ubuntu Core 22 on <no ip address> (tty1)

When I remove br0 and have enp2s0 getting an IP address, the service restarts no longer occur and the screen output shows an IP address.

I tried a solution according to this post to disable the related services but nothing helps. I have tried to run sudo systemctl disable <service> for getty-static.service, getty@tty1.service, console-conf@tty1.service and console-getty.service. None of them solve the problem.

Any ideas?

I found somewhere to run sudo console-conf. I ran this after reproducing the bug as mentioned above and console-conf crashes and the system no longer boots.

that will indeed disable the interface for outbound use and only set up a bridge on top of it … have you tried setting dhcp: yes instead, so that it gets properly configured for outbound traffic ?

I have. Once you put a bridge on top, the interface itself no longer gets an IP, only the bridge (which it’s the machine’s IP now). So putting dhcp4: true doesn’t make the interface get an IP as well and the error persists.

well, it seems to be supposed to work in the examples of the documentation on netplan.io

btw the getty services have nothing to do with network setup, they just display the ip (if there is one), you should not disable them … and indeed console-conf is not designed for changing setups (even though this was possible in the past it has never been the intended purpose), only for initial setup …

You can try it. It doesn’t work, related to netplan. Once you define a bridge containing the interface, it is the one to get an IP, not the interface itself. It’s a recommended setup for LXD when you want containers to be connected to the same network as the host machine.

It’s odd since Ubuntu core and LXD are both from Canonical and I guess they should work together with a common LXD setup. Ubuntu core would be a nice host os if it worked, but with the constant journal spam it doesn’t seem reliable.

I can verify the issue. While my test laptop was using wlp1s0 instead of enp2s0, I still saw the ip get assigned to br0 instead of the interface. And using dhcp4: true doesn’t matter.

The Netplan configuration looks completely fine and, based on the ip a output, it was applied correctly. I tried the same here and I can confirm it works (I used dhcp4: true in my bridge). Everything works fine, ssh into the instance, snap install stuff and etc.

The problem seems to be console-conf. It can’t find the bridge IP address. Digging a little in to the code, I’ve found that the method used to get the system’s IP addresses get_ips_standalone(), implemented in subquity, skips bridges and other network types: see https://github.com/canonical/subiquity/blob/main/subiquitycore/ssh.py#L113

NETDEV_IGNORED_IFACE_TYPES = [
    "lo",
    "bridge",
    "tun",
    "tap",
    "dummy",
    "sit",
    "can",
    "???",
]

Bridges are ignored and that’s why it can’t find the IP address.

So that seems to be the reason why UC will not work properly with this setup.