[Bug 2083029] Re: Try does not recover network

Wesley Hershberger 2083029 at bugs.launchpad.net
Fri Mar 21 18:26:53 UTC 2025


I've done some more looking at this and the bug runs pretty deep. During
`netplan try`, netplan backs up both its configuration in /etc/netplan
and the backend configurations for systemd-networkd and NetworkManager
[1]. The problem with this is that the restored config files aren't
picked up by systemd-networkd (even with `networkctl reload`), because a
`systemctl daemon-reload` is required in order to detect the changed
files.

I stat'ed /run/systemd/network during a `netplan try`; the inode numbers change after the revert since the backup directory was moved.
```
$ stat network
  File: network
  Size: 60        	Blocks: 0          IO Block: 4096   directory
Device: 0,26	Inode: 5739        Links: 2
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2025-03-21 10:43:06.922283238 -0500
Modify: 2025-03-21 10:43:06.703278532 -0500
Change: 2025-03-21 10:43:06.703278532 -0500
 Birth: 2025-03-21 10:14:58.081808256 -0500
$ stat network
  File: network
  Size: 60        	Blocks: 0          IO Block: 4096   directory
Device: 0,26	Inode: 6005        Links: 2
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2025-03-21 10:43:13.057415020 -0500
Modify: 2025-03-21 10:42:28.856463577 -0500
Change: 2025-03-21 10:43:13.055414977 -0500
Birth: 2025-03-21 10:43:13.055414977 -0500
```

It was a nice idea to avoid running the netplan generator during revert
[2]; it just doesn't work. Indeed, writing a static IP for an interface
that was using dhcp and `netplan try`ing it doesn't revert the static
IP.

Working on a PR to address this in netplan upstream.

[1] https://github.com/canonical/netplan/blob/main/netplan_cli/configmanager.py#L126
[2] https://github.com/canonical/netplan/blob/main/netplan_cli/cli/commands/try_command.py#L145

** Also affects: netplan.io (Ubuntu)
   Importance: Undecided
       Status: New

** Also affects: netplan.io (Ubuntu Oracular)
   Importance: Undecided
       Status: New

** Also affects: netplan.io (Ubuntu Noble)
   Importance: Undecided
       Status: New

** Also affects: netplan.io (Ubuntu Jammy)
   Importance: Undecided
       Status: New

** Also affects: netplan.io (Ubuntu Plucky)
   Importance: Undecided
       Status: New

** Also affects: netplan.io (Ubuntu Focal)
   Importance: Undecided
       Status: New

** Changed in: netplan
       Status: Confirmed => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to netplan.io in Ubuntu.
Matching subscriptions: foundations-bugs
https://bugs.launchpad.net/bugs/2083029

Title:
  Try does not recover network

Status in Netplan:
  In Progress
Status in netplan.io package in Ubuntu:
  New
Status in netplan.io source package in Focal:
  New
Status in netplan.io source package in Jammy:
  New
Status in netplan.io source package in Noble:
  New
Status in netplan.io source package in Oracular:
  New
Status in netplan.io source package in Plucky:
  New

Bug description:
  Netplan try fails to rollback network changes after an edit to /etc/netplan/50-cloud-init.yaml
  ```
  network:
      ethernets:
          eno1:
              addresses:
                - 10.1.0.221/23
                - 10.1.1.181/23
  ```
  I removed an IP address and ran "netplan try" and lost ssh. Connection should return after 2min, but that doesn't happen.

To manage notifications about this bug go to:
https://bugs.launchpad.net/netplan/+bug/2083029/+subscriptions




More information about the foundations-bugs mailing list