Activity log for bug #2077194

Date Who What changed Old value New value Message
2024-08-16 19:42:24 Chris Martin bug added bug
2024-08-16 19:47:03 Chris Martin description On Ubuntu 24.04 LTS, it appears that Netplan cannot bring up a system's network interfaces on boot if a graphical desktop environment is installed, but NetworkManager is not installed. For background: The overall goal is to offer cloud instances with a pre-installed desktop environment, but without NetworkManager's complexity (and opportunity for the user to break their own connectivity by clicking buttons in GNOME Settings). The users are researchers running a mix of graphical and command-line software. We use cloud-init to configure networking on our cloud instances (which essentially creates `/etc/netplan/50-cloud-init.yaml`). Our goal of using Netplan without NetworkManager seems to align with Netplan's design: "Retains the flexibility to [...] adjust to `apt purge network-manager`". (https://netplan.io/design) How I reproduce the issue: - Start with a clean Ubuntu 24.04 LTS system. I create an OpenStack instance from the cloud image (https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img). - Optionally, set a password for local `ubuntu` user for later troubleshooting on the console (after losing network connectivity). - Upgrade to Netplan 1.0.1-1ubuntu2 or later (see steps in appendix A below) to avoid getting stuck by LP: #1999178 when you install the desktop environment. - To prevent APT from installing NetworkManager with the desktop environment: `sudo apt-mark hold network-manager network-manager-config-connectivity-ubuntu network-manager-openvpn-gnome network-manager-pptp-gnome` - Install the desktop environment: `sudo apt-get install ubuntu-desktop-minimal`. - Optionally, to ease troubleshooting, prevent the graphical session from starting on boot: `sudo systemctl set-default multi-user.target`. - Reboot. On reboot, the instance starts up but does not get network connectivity. If I log in to the instance console and run `sudo netplan apply`, I get this Python traceback: ``` Failed to start NetworkManager.service: Unit NetworkManager.service not found. Traceback (most recent call last): File "/usr/sbin/netplan", line 23, in <module> netplan.main() File "/usr/share/netplan/netplan_cli/cli/core.py", line 58, in main self.run_command() File "/usr/share/netplan/netplan_cli/cli/utils.py", line 298, in run_command self.func() File "/usr/share/netplan/netplan_cli/cli/commands/apply.py", line 65, in run self.run_command() File "/usr/share/netplan/netplan_cli/cli/utils.py", line 298, in run_command self.func() File "/usr/share/netplan/netplan_cli/cli/commands/apply.py", line 302, in command_apply utils.systemctl_network_manager('start', sync=sync) File "/usr/share/netplan/netplan_cli/cli/utils.py", line 105, in systemctl_network_manager return systemctl(action, [NM_SERVICE_NAME], sync) # pragma: nocover (covered in autopkgtest) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/netplan/netplan_cli/cli/utils.py", line 117, in systemctl subprocess.check_call(command) File "/usr/lib/python3.12/subprocess.py", line 413, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['systemctl', 'start', '--no-block', 'NetworkManager.service']' returned non-zero exit status 5 ``` So Netplan is trying and failing to start the NetworkManager systemd service, even though NetworkManager was _never installed_ on this system. I get a similar result if I allow NetworkManager to install with the desktop environment (skip the `apt-mark hold` step above), but mask its systemd services. Appendix A: How I upgraded Netplan on 24.04 LTS - In `/etc/apt/apt.conf.d/01-vendor-ubuntu`, add line `APT::Default-Release "noble";` - In `/etc/apt/sources.list.d/ubuntu.sources`, add word `oracular` to the line `Suites: noble noble-updates noble-backports` - In `/etc/apt/preferences.d`, created file `pinning` with following contents: ``` Package: * Pin: release a=oracular Pin-Priority: 100 ``` - `apt update` - To get the newest version of Netplan, 1.1-1: `sudo apt install netplan.io/oracular netplan-generator/oracular python3-netplan/oracular` On Ubuntu 24.04 LTS, it appears that Netplan cannot bring up a system's network interfaces on boot if a graphical desktop environment is installed, but NetworkManager is not installed. For background: The overall goal is to offer cloud instances with a pre-installed desktop environment, but without NetworkManager's complexity (and opportunity for the user to break their own connectivity by clicking buttons in GNOME Settings). The users are researchers running a mix of graphical and command-line software. We use cloud-init to configure networking on our cloud instances (which essentially creates `/etc/netplan/50-cloud-init.yaml`, see contents in appendix below). Our goal of using Netplan without NetworkManager seems to align with Netplan's design: "Retains the flexibility to [...] adjust to `apt purge network-manager`". (https://netplan.io/design) How I reproduce the issue: - Start with a clean Ubuntu 24.04 LTS system. I create an OpenStack instance from the cloud image (https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img). - Optionally, set a password for local `ubuntu` user for later troubleshooting on the console (after losing network connectivity). - Upgrade to Netplan 1.0.1-1ubuntu2 or later (see steps in appendix A below) to avoid getting stuck by LP: #1999178 when you install the desktop environment. - To prevent APT from installing NetworkManager with the desktop environment: `sudo apt-mark hold network-manager network-manager-config-connectivity-ubuntu network-manager-openvpn-gnome network-manager-pptp-gnome` - Install the desktop environment: `sudo apt-get install ubuntu-desktop-minimal`. - Optionally, to ease troubleshooting, prevent the graphical session from starting on boot: `sudo systemctl set-default multi-user.target`. - Reboot. On reboot, the instance starts up but does not get network connectivity. If I log in to the instance console and run `sudo netplan apply`, I get this Python traceback: ``` Failed to start NetworkManager.service: Unit NetworkManager.service not found. Traceback (most recent call last):   File "/usr/sbin/netplan", line 23, in <module>     netplan.main()   File "/usr/share/netplan/netplan_cli/cli/core.py", line 58, in main     self.run_command()   File "/usr/share/netplan/netplan_cli/cli/utils.py", line 298, in run_command     self.func()   File "/usr/share/netplan/netplan_cli/cli/commands/apply.py", line 65, in run     self.run_command()   File "/usr/share/netplan/netplan_cli/cli/utils.py", line 298, in run_command     self.func()   File "/usr/share/netplan/netplan_cli/cli/commands/apply.py", line 302, in command_apply     utils.systemctl_network_manager('start', sync=sync)   File "/usr/share/netplan/netplan_cli/cli/utils.py", line 105, in systemctl_network_manager     return systemctl(action, [NM_SERVICE_NAME], sync) # pragma: nocover (covered in autopkgtest)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "/usr/share/netplan/netplan_cli/cli/utils.py", line 117, in systemctl     subprocess.check_call(command)   File "/usr/lib/python3.12/subprocess.py", line 413, in check_call     raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['systemctl', 'start', '--no-block', 'NetworkManager.service']' returned non-zero exit status 5 ``` So Netplan is trying and failing to start the NetworkManager systemd service, even though NetworkManager was _never installed_ on this system. I get a similar result if I allow NetworkManager to install with the desktop environment (skip the `apt-mark hold` step above), but mask its systemd services. --- Appendix A: How I upgraded Netplan on 24.04 LTS - In `/etc/apt/apt.conf.d/01-vendor-ubuntu`, add line `APT::Default-Release "noble";` - In `/etc/apt/sources.list.d/ubuntu.sources`, add word `oracular` to the line `Suites: noble noble-updates noble-backports` - In `/etc/apt/preferences.d`, created file `pinning` with following contents: ``` Package: * Pin: release a=oracular Pin-Priority: 100 ``` - `apt update` - To get the newest version of Netplan, 1.1-1: `sudo apt install netplan.io/oracular netplan-generator/oracular python3-netplan/oracular` --- Appendix B: contents of our `/etc/netplan/50-cloud-init.yaml` ``` network: version: 2 ethernets: enp1s0: dhcp4: true match: macaddress: fa:16:3e:69:d9:ee set-name: enp1s0 ```
2024-08-19 14:12:39 Lukas Märdian netplan: status New Triaged
2024-08-19 14:12:41 Lukas Märdian netplan: importance Undecided Medium