netplan apply does not remove systemd service for wlan0 after config removed

Bug #1874494 reported by Paul Larson
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Netplan
Fix Released
Wishlist
Lukas Märdian
netplan.io (Ubuntu)
Fix Released
Wishlist
Lukas Märdian
Focal
Fix Released
Wishlist
Unassigned

Bug Description

Summary
=======

Problem found when focal-preinstalled-server-armhf 20200423.1 image on RPI4
netplan.io version 0.99-0ubuntu2

When testing wifi, I confirmed it worked and was able to connect to the device with ethernet unplugged. After doing this, I removed the netplan config for wifi and ran netplan apply.

ubuntu@ubuntu:~$ sudo rm /etc/netplan/wifi.yaml
ubuntu@ubuntu:~$ sudo netplan apply
Warning: The unit file, source configuration file or drop-ins of netplan-wpa-wlan0.service ch
anged on disk. Run 'systemctl daemon-reload' to reload units.
Warning: The unit file, source configuration file or drop-ins of netplan-wpa-wlan0.service ch
anged on disk. Run 'systemctl daemon-reload' to reload units.

So I did the daemon-reload and tried again:
ubuntu@ubuntu:~$ sudo systemctl daemon-reload
ubuntu@ubuntu:~$ sudo netplan apply
Failed to start netplan-wpa-wlan0.service: Unit netplan-wpa-wlan0.service not found.
Traceback (most recent call last):
  File "/usr/sbin/netplan", line 23, in <module>
    netplan.main()
  File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 179, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 46, in run
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 179, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 173, in command_apply
    utils.systemctl_networkd('start', sync=sync, extra_services=netplan_wpa)
  File "/usr/share/netplan/netplan/cli/utils.py", line 86, in systemctl_networkd
    subprocess.check_call(command)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['systemctl', 'start', '--no-block', 'systemd-networkd.service', 'netplan-wpa-wlan0.service']' returned non-zero exit status 5.

At no point did ethernet start working, until I rebooted. systemctl showed that netplan-wpa-wlan0.service still existed, but was dead. After a reboot, that service was gone though, and ethernet worked fine.

Steps to reproduce
==================
1. configure wifi on rpi via netplan
2. remove the wifi config after confirming it works
3. run netplan apply
(optional)
4. run sudo systemctl daemon-reload
5. run netplan apply again

Related branches

tags: added: rls-ff-incoming
Changed in netplan.io (Ubuntu):
milestone: none → ubuntu-20.04.1
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1874494

tags: added: iso-testing
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in netplan.io (Ubuntu):
status: New → Confirmed
Changed in netplan.io (Ubuntu Focal):
milestone: none → ubuntu-20.04.1
Changed in netplan.io (Ubuntu):
milestone: ubuntu-20.04.1 → ubuntu-20.06
Changed in netplan.io (Ubuntu Focal):
status: New → Triaged
importance: Undecided → High
Changed in netplan.io (Ubuntu):
importance: Undecided → High
Revision history for this message
Lukas Märdian (slyon) wrote :

Hi Paul,

thanks for reporting this bug. I was able to reproduce it on RPi 3 with netplan.io 0.99-0ubuntu2.

But I think this should already be fixed with netplan.io 0.99-0ubuntu3~20.04.1 from the 'focal-proposed' pocket, at least partially. The "daemon-reload" part might still need some fixing...

Would you be able to re-test with version 0.99-0ubuntu3~20.04.1 from proposed?

I.e. edit /etc/apt/sources.list and add the following line:
deb http://ports.ubuntu.com/ubuntu-ports focal-proposed main restricted universe multiverse

Then: 'sudo apt update' & 'sudo apt install netplan.io', which should update your netplan.io version.

tags: added: id-5eb42e64b38b471f544f4e26
Revision history for this message
Paul Larson (pwlars) wrote :

I do still get this warning:
ubuntu@ubuntu:~$ sudo netplan apply
Warning: The unit file, source configuration file or drop-ins of netplan-wpa-wlan0.service changed on disk. Run
'systemctl daemon-reload' to reload units.

But even after doing a daemon-reload and running netplan-apply, I never get the error mentioned in the original report

Revision history for this message
Lukas Märdian (slyon) wrote :

Thank you for confirming that the crash does not happen any more with netplan.io 0.99-0ubuntu3*

I'm working on a fix for the 'daemon-reload' warning upstream:
https://github.com/CanonicalLtd/netplan/pull/135

Changed in netplan:
assignee: nobody → Lukas Märdian (slyon)
Lukas Märdian (slyon)
Changed in netplan:
importance: Undecided → Medium
status: New → In Progress
Lukas Märdian (slyon)
Changed in netplan:
status: In Progress → Fix Committed
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

@pwlars given the crash is fixed this bug report is only about the daemon-reload message now.

tags: added: uc20
Changed in netplan.io (Ubuntu):
status: Confirmed → Fix Committed
Changed in netplan.io (Ubuntu Focal):
status: Triaged → Fix Committed
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Crash fix is available in edge channel.

Changed in netplan.io (Ubuntu Focal):
status: Fix Committed → In Progress
Changed in netplan.io (Ubuntu):
status: Fix Committed → In Progress
importance: High → Wishlist
Changed in netplan.io (Ubuntu Focal):
importance: High → Wishlist
Changed in netplan:
importance: Medium → Wishlist
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Lowering priority, as the daemon-reload message is shown to the user, and they can rectify things bug running it.

The crash was something they couldn't trivially fix, hence with original bug report and without the first fix it was of higher priority.

tags: removed: rls-ff-incoming
Lukas Märdian (slyon)
Changed in netplan.io (Ubuntu):
assignee: nobody → Lukas Märdian (slyon)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netplan.io - 0.99-0ubuntu5

---------------
netplan.io (0.99-0ubuntu5) groovy; urgency=medium

  * d/p/0001-Fix-autopkgtest-on-arm64-with-NM-1.24-146.patch
    - Fix autopkgtest failure on arm64 in combination with new NM-1.24
  * d/p/0001-Call-daemon-reload-after-we-touched-systemd-unit-fil.patch
    - Re-calculate systemd dependencies, after touching .service
      units (LP: #1874494)

 -- Lukas Märdian <email address hidden> Thu, 18 Jun 2020 11:36:59 +0200

Changed in netplan.io (Ubuntu):
status: In Progress → Fix Released
Lukas Märdian (slyon)
Changed in netplan:
status: Fix Committed → Fix Released
Lukas Märdian (slyon)
Changed in netplan.io (Ubuntu Focal):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package netplan.io - 0.100-0ubuntu4~20.04.2

---------------
netplan.io (0.100-0ubuntu4~20.04.2) focal; urgency=medium

  * Backport netplan.io 0.100-0ubuntu4 to 20.04 (LP: #1894197)
    - Includes fix for OVS/WPA first-time boot issues
  * Drop distro patches, which are included in upstream release
  * Ignore openvswitch-switch Build-Depends on riscv64, due to missing package
    - Failing unit-/integration tests will be ignored on riscv64 as well
  * Skip specific unit-tests on riscv64

 -- Lukas Märdian <email address hidden> Wed, 30 Sep 2020 14:32:36 +0200

Changed in netplan.io (Ubuntu Focal):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.