Activity log for bug #1959570

Date Who What changed Old value New value Message
2022-01-31 10:51:40 Michael Vogt bug added bug
2022-01-31 10:51:40 Michael Vogt attachment added full journal log https://bugs.launchpad.net/bugs/1959570/+attachment/5558406/+files/nm-crash-full-journal.txt
2022-01-31 10:53:09 Michael Vogt description When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working.
2022-02-10 17:13:10 Lukas Märdian tags fr-2041
2022-08-19 08:04:35 Launchpad Janitor netplan.io (Ubuntu): status New Confirmed
2023-03-23 11:35:15 Lukas Märdian netplan.io (Ubuntu): status Confirmed In Progress
2023-03-23 11:35:34 Lukas Märdian bug task added netplan
2023-03-23 11:35:55 Lukas Märdian netplan.io (Ubuntu): status In Progress Confirmed
2023-03-23 11:35:57 Lukas Märdian netplan: status New In Progress
2023-03-23 11:36:00 Lukas Märdian netplan: assignee Lukas Märdian (slyon)
2023-03-23 11:36:06 Lukas Märdian netplan.io (Ubuntu): status Confirmed Triaged
2023-03-23 11:36:08 Lukas Märdian netplan.io (Ubuntu): importance Undecided High
2023-03-23 13:15:32 Lukas Märdian nominated for series Ubuntu Kinetic
2023-03-23 13:15:32 Lukas Märdian bug task added netplan.io (Ubuntu Kinetic)
2023-03-23 13:15:32 Lukas Märdian nominated for series Ubuntu Lunar
2023-03-23 13:15:32 Lukas Märdian bug task added netplan.io (Ubuntu Lunar)
2023-03-23 13:15:32 Lukas Märdian nominated for series Ubuntu Focal
2023-03-23 13:15:32 Lukas Märdian bug task added netplan.io (Ubuntu Focal)
2023-03-23 13:15:32 Lukas Märdian nominated for series Ubuntu Jammy
2023-03-23 13:15:32 Lukas Märdian bug task added netplan.io (Ubuntu Jammy)
2023-04-03 14:26:54 Lukas Märdian netplan: status In Progress Fix Committed
2023-04-03 14:41:13 Lukas Märdian netplan.io (Ubuntu Lunar): status Triaged Fix Committed
2023-04-03 14:41:15 Lukas Märdian netplan.io (Ubuntu Kinetic): status New Invalid
2023-04-05 01:19:03 Launchpad Janitor netplan.io (Ubuntu Lunar): status Fix Committed Fix Released
2023-06-22 09:24:59 Lukas Märdian netplan: status Fix Committed Fix Released
2023-07-25 09:33:13 Launchpad Janitor netplan.io (Ubuntu Focal): status New Confirmed
2023-07-25 09:33:13 Launchpad Janitor netplan.io (Ubuntu Jammy): status New Confirmed
2023-08-11 09:14:53 Alfonso Sanchez-Beato bug added subscriber Alfonso Sanchez-Beato
2023-08-23 12:08:33 Lukas Märdian tags fr-2041 fr-2041 sru-next
2023-08-23 14:21:44 Lukas Märdian tags fr-2041 sru-next foundations-todo fr-2041 sru-next
2023-08-29 13:34:01 Lukas Märdian netplan.io (Ubuntu Jammy): status Confirmed Won't Fix
2023-08-29 15:36:54 Lukas Märdian description When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working. [ Impact ] * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable. * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3 "ens3" ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500 ip4 default inet4 10.0.2.15/24 route4 0.0.0.0/0 route4 10.0.2.0/24 inet6 fe80::5054:ff:fe12:3456/64 route6 fe80::/64 lo: unmanaged "lo" loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration: servers: 10.0.2.3 interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ============================== Network connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network: version: 2 renderer: NetworkManager ethernets: ens3: dhcp4: true bridges: br54: dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3 "ens3" ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500 ip4 default, ip6 default inet4 10.0.2.15/24 route4 0.0.0.0/0 route4 10.0.2.0/24 inet6 fec0::5054:ff:fe12:3456/64 inet6 fe80::5054:ff:fe12:3456/64 route6 fe80::/64 route6 ::/0 route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54 "br54" bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged "lo" loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration: servers: 10.0.2.3 interface: ens3 [ Where problems could occur ] * Netplan is a core component, thus changing it bears a high risk * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong. * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ] * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1) * This has been fixed upstream in https://github.com/canonical/netplan/pull/336 * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working.
2023-08-29 15:38:05 Lukas Märdian description [ Impact ] * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable. * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3 "ens3" ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500 ip4 default inet4 10.0.2.15/24 route4 0.0.0.0/0 route4 10.0.2.0/24 inet6 fe80::5054:ff:fe12:3456/64 route6 fe80::/64 lo: unmanaged "lo" loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration: servers: 10.0.2.3 interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ============================== Network connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network: version: 2 renderer: NetworkManager ethernets: ens3: dhcp4: true bridges: br54: dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3 "ens3" ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500 ip4 default, ip6 default inet4 10.0.2.15/24 route4 0.0.0.0/0 route4 10.0.2.0/24 inet6 fec0::5054:ff:fe12:3456/64 inet6 fe80::5054:ff:fe12:3456/64 route6 fe80::/64 route6 ::/0 route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54 "br54" bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged "lo" loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration: servers: 10.0.2.3 interface: ens3 [ Where problems could occur ] * Netplan is a core component, thus changing it bears a high risk * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong. * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ] * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1) * This has been fixed upstream in https://github.com/canonical/netplan/pull/336 * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working. [ Impact ]  * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.  * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] ============================== Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap ============================== $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ==============================  Network connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network:   version: 2   renderer: NetworkManager   ethernets:     ens3:       dhcp4: true   bridges:     br54:       dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default, ip6 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fec0::5054:ff:fe12:3456/64         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64         route6 ::/0         route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54         "br54"         bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 [ Where problems could occur ]  * Netplan is a core component, thus changing it bears a high risk  * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.  * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ]  * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)  * This has been fixed upstream in https://github.com/canonical/netplan/pull/336  * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working.
2023-08-29 15:38:38 Lukas Märdian description [ Impact ]  * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.  * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] ============================== Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap ============================== $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ==============================  Network connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network:   version: 2   renderer: NetworkManager   ethernets:     ens3:       dhcp4: true   bridges:     br54:       dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default, ip6 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fec0::5054:ff:fe12:3456/64         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64         route6 ::/0         route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54         "br54"         bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 [ Where problems could occur ]  * Netplan is a core component, thus changing it bears a high risk  * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.  * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ]  * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)  * This has been fixed upstream in https://github.com/canonical/netplan/pull/336  * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working. [ Impact ]  * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.  * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] ============================== Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap ============================== $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ==============================  Network/SSH connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network:   version: 2   renderer: NetworkManager   ethernets:     ens3:       dhcp4: true   bridges:     br54:       dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default, ip6 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fec0::5054:ff:fe12:3456/64         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64         route6 ::/0         route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54         "br54"         bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 [ Where problems could occur ]  * Netplan is a core component, thus changing it bears a high risk  * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.  * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ]  * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)  * This has been fixed upstream in https://github.com/canonical/netplan/pull/336  * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working.
2023-08-29 15:41:52 Lukas Märdian netplan.io (Ubuntu Focal): status Confirmed In Progress
2023-08-29 15:41:57 Lukas Märdian bug added subscriber Ubuntu Stable Release Updates Team
2023-08-29 15:43:57 Ubuntu Archive Robot bug added subscriber Lukas Märdian
2023-10-16 15:50:27 Lukas Märdian description [ Impact ]  * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.  * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] ============================== Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap ============================== $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ==============================  Network/SSH connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network:   version: 2   renderer: NetworkManager   ethernets:     ens3:       dhcp4: true   bridges:     br54:       dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default, ip6 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fec0::5054:ff:fe12:3456/64         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64         route6 ::/0         route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54         "br54"         bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 [ Where problems could occur ]  * Netplan is a core component, thus changing it bears a high risk  * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.  * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ]  * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)  * This has been fixed upstream in https://github.com/canonical/netplan/pull/336  * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working. [ Impact ]  * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.  * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] ============================== Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap ============================== $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ==============================  Network/SSH connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network:   version: 2   renderer: NetworkManager   ethernets:     ens3:       dhcp4: true   bridges:     br54:       dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default, ip6 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fec0::5054:ff:fe12:3456/64         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64         route6 ::/0         route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54         "br54"         bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 [ Test Plan 2 "Classic" ] $ apt install network-manager $ netplan get network: version: 2 ethernets: eth0: dhcp4: true $ netplan set network.renderer=NetworkManager # change global renderer to NM $ netplan set network.bridges.br54.addresses=[10.0.0.20/24] $ netplan get network: version: 2 renderer: NetworkManager ethernets: eth0: dhcp4: true bridges: br54: addresses: - "10.0.0.20/24" $ netplan apply # Apply configuration => Check that the "netplan-br54" connection is "connected" and the "br54" got created correctly with IP address 10.0.0.20/24: $ nmcli d show br54 GENERAL.DEVICE: br54 GENERAL.TYPE: bridge GENERAL.HWADDR: 6E:70:F7:76:39:67 GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: netplan-br54 GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2 IP4.ADDRESS[1]: 10.0.0.20/24 IP4.GATEWAY: -- IP4.ROUTE[1]: dst = 10.0.0.0/24, nh = 0.0.0.0, mt = 425 $ ip addr show br54 5: br54: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000 link/ether 6e:70:f7:76:39:67 brd ff:ff:ff:ff:ff:ff inet 10.0.0.20/24 brd 10.0.0.255 scope global noprefixroute br54 valid_lft forever preferred_lft forever [ Where problems could occur ]  * Netplan is a core component, thus changing it bears a high risk  * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.  * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ]  * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)  * This has been fixed upstream in https://github.com/canonical/netplan/pull/336  * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working.
2023-10-16 15:57:15 Lukas Märdian description [ Impact ]  * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.  * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] ============================== Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap ============================== $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ==============================  Network/SSH connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network:   version: 2   renderer: NetworkManager   ethernets:     ens3:       dhcp4: true   bridges:     br54:       dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default, ip6 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fec0::5054:ff:fe12:3456/64         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64         route6 ::/0         route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54         "br54"         bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 [ Test Plan 2 "Classic" ] $ apt install network-manager $ netplan get network: version: 2 ethernets: eth0: dhcp4: true $ netplan set network.renderer=NetworkManager # change global renderer to NM $ netplan set network.bridges.br54.addresses=[10.0.0.20/24] $ netplan get network: version: 2 renderer: NetworkManager ethernets: eth0: dhcp4: true bridges: br54: addresses: - "10.0.0.20/24" $ netplan apply # Apply configuration => Check that the "netplan-br54" connection is "connected" and the "br54" got created correctly with IP address 10.0.0.20/24: $ nmcli d show br54 GENERAL.DEVICE: br54 GENERAL.TYPE: bridge GENERAL.HWADDR: 6E:70:F7:76:39:67 GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: netplan-br54 GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2 IP4.ADDRESS[1]: 10.0.0.20/24 IP4.GATEWAY: -- IP4.ROUTE[1]: dst = 10.0.0.0/24, nh = 0.0.0.0, mt = 425 $ ip addr show br54 5: br54: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000 link/ether 6e:70:f7:76:39:67 brd ff:ff:ff:ff:ff:ff inet 10.0.0.20/24 brd 10.0.0.255 scope global noprefixroute br54 valid_lft forever preferred_lft forever [ Where problems could occur ]  * Netplan is a core component, thus changing it bears a high risk  * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.  * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ]  * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)  * This has been fixed upstream in https://github.com/canonical/netplan/pull/336  * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working. [ Impact ]  * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.  * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] ============================== Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap ============================== $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ==============================  Network/SSH connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network:   version: 2   renderer: NetworkManager   ethernets:     ens3:       dhcp4: true   bridges:     br54:       dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default, ip6 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fec0::5054:ff:fe12:3456/64         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64         route6 ::/0         route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54         "br54"         bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 [ Test Plan 2 "Classic" ] $ apt install network-manager $ netplan get network:   version: 2   ethernets:     eth0:       dhcp4: true $ netplan set network.renderer=NetworkManager # change global renderer to NM $ netplan set network.bridges.br54.addresses=[10.0.0.20/24] $ netplan get network:   version: 2   renderer: NetworkManager   ethernets:     eth0:       dhcp4: true   bridges:     br54:       addresses:       - "10.0.0.20/24" $ unset PATH # Clear PATH $ /usr/sbin/netplan apply # Apply configuration => Check that the "netplan-br54" connection is "connected" and the "br54" got created correctly with IP address 10.0.0.20/24: $ /usr/bin/nmcli d show br54 GENERAL.DEVICE: br54 GENERAL.TYPE: bridge GENERAL.HWADDR: 6E:70:F7:76:39:67 GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: netplan-br54 GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2 IP4.ADDRESS[1]: 10.0.0.20/24 IP4.GATEWAY: -- IP4.ROUTE[1]: dst = 10.0.0.0/24, nh = 0.0.0.0, mt = 425 $ /usr/bin/ip addr show br54 5: br54: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000     link/ether 6e:70:f7:76:39:67 brd ff:ff:ff:ff:ff:ff     inet 10.0.0.20/24 brd 10.0.0.255 scope global noprefixroute br54        valid_lft forever preferred_lft forever [ Where problems could occur ]  * Netplan is a core component, thus changing it bears a high risk  * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.  * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ]  * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)  * This has been fixed upstream in https://github.com/canonical/netplan/pull/336  * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working.
2023-10-26 12:24:19 Lukas Märdian description [ Impact ]  * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.  * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] ============================== Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap ============================== $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ==============================  Network/SSH connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network:   version: 2   renderer: NetworkManager   ethernets:     ens3:       dhcp4: true   bridges:     br54:       dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default, ip6 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fec0::5054:ff:fe12:3456/64         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64         route6 ::/0         route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54         "br54"         bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 [ Test Plan 2 "Classic" ] $ apt install network-manager $ netplan get network:   version: 2   ethernets:     eth0:       dhcp4: true $ netplan set network.renderer=NetworkManager # change global renderer to NM $ netplan set network.bridges.br54.addresses=[10.0.0.20/24] $ netplan get network:   version: 2   renderer: NetworkManager   ethernets:     eth0:       dhcp4: true   bridges:     br54:       addresses:       - "10.0.0.20/24" $ unset PATH # Clear PATH $ /usr/sbin/netplan apply # Apply configuration => Check that the "netplan-br54" connection is "connected" and the "br54" got created correctly with IP address 10.0.0.20/24: $ /usr/bin/nmcli d show br54 GENERAL.DEVICE: br54 GENERAL.TYPE: bridge GENERAL.HWADDR: 6E:70:F7:76:39:67 GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: netplan-br54 GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2 IP4.ADDRESS[1]: 10.0.0.20/24 IP4.GATEWAY: -- IP4.ROUTE[1]: dst = 10.0.0.0/24, nh = 0.0.0.0, mt = 425 $ /usr/bin/ip addr show br54 5: br54: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000     link/ether 6e:70:f7:76:39:67 brd ff:ff:ff:ff:ff:ff     inet 10.0.0.20/24 brd 10.0.0.255 scope global noprefixroute br54        valid_lft forever preferred_lft forever [ Where problems could occur ]  * Netplan is a core component, thus changing it bears a high risk  * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.  * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ]  * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)  * This has been fixed upstream in https://github.com/canonical/netplan/pull/336  * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working. [ Impact ]  * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.  * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] ============================== Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap ============================== $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ==============================  Network/SSH connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network:   version: 2   renderer: NetworkManager   ethernets:     ens3:       dhcp4: true   bridges:     br54:       dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default, ip6 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fec0::5054:ff:fe12:3456/64         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64         route6 ::/0         route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54         "br54"         bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 [ Test Plan 2 "Classic" ] # Prepare environment with NetworkManager installed an the 'nmcli' binary moved to /snap/bin/nmcli (outside of PATH and outside of Python's default fallback PATH). $ apt install network-manager $ mv /usr/bin/nmcli /snap/bin/nmcli $ netplan get network:   version: 2   ethernets:     eth0:       dhcp4: true $ netplan set network.renderer=NetworkManager # change global renderer to NM $ netplan set network.bridges.br54.addresses=[10.0.0.20/24] $ netplan get network:   version: 2   renderer: NetworkManager   ethernets:     eth0:       dhcp4: true   bridges:     br54:       addresses:       - "10.0.0.20/24" $ env -u PATH /usr/sbin/netplan try # Try-Apply the configuration => This should NOT crash! => Check that the "netplan-br54" connection is "connected" and the "br54" got created correctly with IP address 10.0.0.20/24: $ /snap/bin/nmcli d show br54 GENERAL.DEVICE: br54 GENERAL.TYPE: bridge GENERAL.HWADDR: 6E:70:F7:76:39:67 GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: netplan-br54 GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2 IP4.ADDRESS[1]: 10.0.0.20/24 IP4.GATEWAY: -- IP4.ROUTE[1]: dst = 10.0.0.0/24, nh = 0.0.0.0, mt = 425 $ ip addr show br54 5: br54: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000     link/ether 6e:70:f7:76:39:67 brd ff:ff:ff:ff:ff:ff     inet 10.0.0.20/24 brd 10.0.0.255 scope global noprefixroute br54        valid_lft forever preferred_lft forever # Running a similar test through 'netplan-dbus' $ killall netplan-dbus $ env -u PATH /usr/lib/netplan/netplan-dbus & $ busctl call io.netplan.Netplan /io/netplan/Netplan io.netplan.Netplan Config o "/io/netplan/Netplan/config/UV0ID2" $ busctl call io.netplan.Netplan /io/netplan/Netplan/config/UV0ID2 io.netplan.Netplan.Config Try u 120 b true $ busctl call io.netplan.Netplan /io/netplan/Netplan/config/UV0ID2 io.netplan.Netplan.Config Apply b true => Make sure the 'netplan-dbus' binary did not crash. [ Where problems could occur ]  * Netplan is a core component, thus changing it bears a high risk  * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.  * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ]  * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)  * This has been fixed upstream in https://github.com/canonical/netplan/pull/336  * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working.
2023-10-26 12:24:54 Lukas Märdian description [ Impact ]  * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.  * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] ============================== Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap ============================== $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ==============================  Network/SSH connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network:   version: 2   renderer: NetworkManager   ethernets:     ens3:       dhcp4: true   bridges:     br54:       dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default, ip6 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fec0::5054:ff:fe12:3456/64         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64         route6 ::/0         route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54         "br54"         bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 [ Test Plan 2 "Classic" ] # Prepare environment with NetworkManager installed an the 'nmcli' binary moved to /snap/bin/nmcli (outside of PATH and outside of Python's default fallback PATH). $ apt install network-manager $ mv /usr/bin/nmcli /snap/bin/nmcli $ netplan get network:   version: 2   ethernets:     eth0:       dhcp4: true $ netplan set network.renderer=NetworkManager # change global renderer to NM $ netplan set network.bridges.br54.addresses=[10.0.0.20/24] $ netplan get network:   version: 2   renderer: NetworkManager   ethernets:     eth0:       dhcp4: true   bridges:     br54:       addresses:       - "10.0.0.20/24" $ env -u PATH /usr/sbin/netplan try # Try-Apply the configuration => This should NOT crash! => Check that the "netplan-br54" connection is "connected" and the "br54" got created correctly with IP address 10.0.0.20/24: $ /snap/bin/nmcli d show br54 GENERAL.DEVICE: br54 GENERAL.TYPE: bridge GENERAL.HWADDR: 6E:70:F7:76:39:67 GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: netplan-br54 GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2 IP4.ADDRESS[1]: 10.0.0.20/24 IP4.GATEWAY: -- IP4.ROUTE[1]: dst = 10.0.0.0/24, nh = 0.0.0.0, mt = 425 $ ip addr show br54 5: br54: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000     link/ether 6e:70:f7:76:39:67 brd ff:ff:ff:ff:ff:ff     inet 10.0.0.20/24 brd 10.0.0.255 scope global noprefixroute br54        valid_lft forever preferred_lft forever # Running a similar test through 'netplan-dbus' $ killall netplan-dbus $ env -u PATH /usr/lib/netplan/netplan-dbus & $ busctl call io.netplan.Netplan /io/netplan/Netplan io.netplan.Netplan Config o "/io/netplan/Netplan/config/UV0ID2" $ busctl call io.netplan.Netplan /io/netplan/Netplan/config/UV0ID2 io.netplan.Netplan.Config Try u 120 b true $ busctl call io.netplan.Netplan /io/netplan/Netplan/config/UV0ID2 io.netplan.Netplan.Config Apply b true => Make sure the 'netplan-dbus' binary did not crash. [ Where problems could occur ]  * Netplan is a core component, thus changing it bears a high risk  * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.  * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ]  * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)  * This has been fixed upstream in https://github.com/canonical/netplan/pull/336  * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working. [ Impact ]  * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.  * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] ============================== Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap ============================== $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ==============================  Network/SSH connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network:   version: 2   renderer: NetworkManager   ethernets:     ens3:       dhcp4: true   bridges:     br54:       dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default, ip6 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fec0::5054:ff:fe12:3456/64         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64         route6 ::/0         route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54         "br54"         bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 [ Test Plan 2 "Classic" ] # Prepare environment with NetworkManager installed and the 'nmcli' binary moved to /snap/bin/nmcli (outside of PATH and outside of Python's default fallback PATH). $ apt install network-manager $ mv /usr/bin/nmcli /snap/bin/nmcli $ netplan get network:   version: 2   ethernets:     eth0:       dhcp4: true $ netplan set network.renderer=NetworkManager # change global renderer to NM $ netplan set network.bridges.br54.addresses=[10.0.0.20/24] $ netplan get network:   version: 2   renderer: NetworkManager   ethernets:     eth0:       dhcp4: true   bridges:     br54:       addresses:       - "10.0.0.20/24" $ env -u PATH /usr/sbin/netplan try # Try-Apply the configuration => This should NOT crash! => Check that the "netplan-br54" connection is "connected" and the "br54" got created correctly with IP address 10.0.0.20/24: $ /snap/bin/nmcli d show br54 GENERAL.DEVICE: br54 GENERAL.TYPE: bridge GENERAL.HWADDR: 6E:70:F7:76:39:67 GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: netplan-br54 GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2 IP4.ADDRESS[1]: 10.0.0.20/24 IP4.GATEWAY: -- IP4.ROUTE[1]: dst = 10.0.0.0/24, nh = 0.0.0.0, mt = 425 $ ip addr show br54 5: br54: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000     link/ether 6e:70:f7:76:39:67 brd ff:ff:ff:ff:ff:ff     inet 10.0.0.20/24 brd 10.0.0.255 scope global noprefixroute br54        valid_lft forever preferred_lft forever # Running a similar test through 'netplan-dbus' $ killall netplan-dbus $ env -u PATH /usr/lib/netplan/netplan-dbus & $ busctl call io.netplan.Netplan /io/netplan/Netplan io.netplan.Netplan Config o "/io/netplan/Netplan/config/UV0ID2" $ busctl call io.netplan.Netplan /io/netplan/Netplan/config/UV0ID2 io.netplan.Netplan.Config Try u 120 b true $ busctl call io.netplan.Netplan /io/netplan/Netplan/config/UV0ID2 io.netplan.Netplan.Config Apply b true => Make sure the 'netplan-dbus' binary did not crash. [ Where problems could occur ]  * Netplan is a core component, thus changing it bears a high risk  * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.  * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ]  * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)  * This has been fixed upstream in https://github.com/canonical/netplan/pull/336  * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working.
2023-10-26 12:31:20 Lukas Märdian description [ Impact ]  * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.  * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] ============================== Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap ============================== $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ==============================  Network/SSH connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network:   version: 2   renderer: NetworkManager   ethernets:     ens3:       dhcp4: true   bridges:     br54:       dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default, ip6 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fec0::5054:ff:fe12:3456/64         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64         route6 ::/0         route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54         "br54"         bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 [ Test Plan 2 "Classic" ] # Prepare environment with NetworkManager installed and the 'nmcli' binary moved to /snap/bin/nmcli (outside of PATH and outside of Python's default fallback PATH). $ apt install network-manager $ mv /usr/bin/nmcli /snap/bin/nmcli $ netplan get network:   version: 2   ethernets:     eth0:       dhcp4: true $ netplan set network.renderer=NetworkManager # change global renderer to NM $ netplan set network.bridges.br54.addresses=[10.0.0.20/24] $ netplan get network:   version: 2   renderer: NetworkManager   ethernets:     eth0:       dhcp4: true   bridges:     br54:       addresses:       - "10.0.0.20/24" $ env -u PATH /usr/sbin/netplan try # Try-Apply the configuration => This should NOT crash! => Check that the "netplan-br54" connection is "connected" and the "br54" got created correctly with IP address 10.0.0.20/24: $ /snap/bin/nmcli d show br54 GENERAL.DEVICE: br54 GENERAL.TYPE: bridge GENERAL.HWADDR: 6E:70:F7:76:39:67 GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: netplan-br54 GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2 IP4.ADDRESS[1]: 10.0.0.20/24 IP4.GATEWAY: -- IP4.ROUTE[1]: dst = 10.0.0.0/24, nh = 0.0.0.0, mt = 425 $ ip addr show br54 5: br54: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000     link/ether 6e:70:f7:76:39:67 brd ff:ff:ff:ff:ff:ff     inet 10.0.0.20/24 brd 10.0.0.255 scope global noprefixroute br54        valid_lft forever preferred_lft forever # Running a similar test through 'netplan-dbus' $ killall netplan-dbus $ env -u PATH /usr/lib/netplan/netplan-dbus & $ busctl call io.netplan.Netplan /io/netplan/Netplan io.netplan.Netplan Config o "/io/netplan/Netplan/config/UV0ID2" $ busctl call io.netplan.Netplan /io/netplan/Netplan/config/UV0ID2 io.netplan.Netplan.Config Try u 120 b true $ busctl call io.netplan.Netplan /io/netplan/Netplan/config/UV0ID2 io.netplan.Netplan.Config Apply b true => Make sure the 'netplan-dbus' binary did not crash. [ Where problems could occur ]  * Netplan is a core component, thus changing it bears a high risk  * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.  * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ]  * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)  * This has been fixed upstream in https://github.com/canonical/netplan/pull/336  * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working. [ Impact ]  * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.  * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] ============================== Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap ============================== $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ==============================  Network/SSH connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network:   version: 2   renderer: NetworkManager   ethernets:     ens3:       dhcp4: true   bridges:     br54:       dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default, ip6 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fec0::5054:ff:fe12:3456/64         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64         route6 ::/0         route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54         "br54"         bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 [ Test Plan 2 "Classic" ] # Prepare environment with NetworkManager installed and the 'nmcli' binary moved to /snap/bin/nmcli (outside of PATH and outside of Python's default/fallback BINDIR). $ apt install network-manager $ mv /usr/bin/nmcli /snap/bin/nmcli $ netplan get network:   version: 2   ethernets:     eth0:       dhcp4: true $ netplan set network.renderer=NetworkManager # change global renderer to NM $ netplan set network.bridges.br54.addresses=[10.0.0.20/24] $ netplan get network:   version: 2   renderer: NetworkManager   ethernets:     eth0:       dhcp4: true   bridges:     br54:       addresses:       - "10.0.0.20/24" $ env -u PATH /usr/sbin/netplan try # Try-Apply the configuration => This should NOT crash! => Check that the "netplan-br54" connection is "connected" and the "br54" got created correctly with IP address 10.0.0.20/24: $ /snap/bin/nmcli d show br54 GENERAL.DEVICE: br54 GENERAL.TYPE: bridge GENERAL.HWADDR: 6E:70:F7:76:39:67 GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: netplan-br54 GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2 IP4.ADDRESS[1]: 10.0.0.20/24 IP4.GATEWAY: -- IP4.ROUTE[1]: dst = 10.0.0.0/24, nh = 0.0.0.0, mt = 425 $ ip addr show br54 5: br54: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000     link/ether 6e:70:f7:76:39:67 brd ff:ff:ff:ff:ff:ff     inet 10.0.0.20/24 brd 10.0.0.255 scope global noprefixroute br54        valid_lft forever preferred_lft forever # Running a similar test through 'netplan-dbus' $ killall netplan-dbus $ env -u PATH /usr/lib/netplan/netplan-dbus & $ busctl call io.netplan.Netplan /io/netplan/Netplan io.netplan.Netplan Config o "/io/netplan/Netplan/config/UV0ID2" $ busctl call io.netplan.Netplan /io/netplan/Netplan/config/UV0ID2 io.netplan.Netplan.Config Try u 120 b true $ busctl call io.netplan.Netplan /io/netplan/Netplan/config/UV0ID2 io.netplan.Netplan.Config Apply b true => Make sure the 'netplan-dbus' binary did not crash. [ Where problems could occur ]  * Netplan is a core component, thus changing it bears a high risk  * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.  * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ]  * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)  * This has been fixed upstream in https://github.com/canonical/netplan/pull/336  * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working.
2023-10-26 12:31:56 Lukas Märdian description [ Impact ]  * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.  * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH, therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] ============================== Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap ============================== $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ==============================  Network/SSH connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network:   version: 2   renderer: NetworkManager   ethernets:     ens3:       dhcp4: true   bridges:     br54:       dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default, ip6 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fec0::5054:ff:fe12:3456/64         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64         route6 ::/0         route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54         "br54"         bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 [ Test Plan 2 "Classic" ] # Prepare environment with NetworkManager installed and the 'nmcli' binary moved to /snap/bin/nmcli (outside of PATH and outside of Python's default/fallback BINDIR). $ apt install network-manager $ mv /usr/bin/nmcli /snap/bin/nmcli $ netplan get network:   version: 2   ethernets:     eth0:       dhcp4: true $ netplan set network.renderer=NetworkManager # change global renderer to NM $ netplan set network.bridges.br54.addresses=[10.0.0.20/24] $ netplan get network:   version: 2   renderer: NetworkManager   ethernets:     eth0:       dhcp4: true   bridges:     br54:       addresses:       - "10.0.0.20/24" $ env -u PATH /usr/sbin/netplan try # Try-Apply the configuration => This should NOT crash! => Check that the "netplan-br54" connection is "connected" and the "br54" got created correctly with IP address 10.0.0.20/24: $ /snap/bin/nmcli d show br54 GENERAL.DEVICE: br54 GENERAL.TYPE: bridge GENERAL.HWADDR: 6E:70:F7:76:39:67 GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: netplan-br54 GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2 IP4.ADDRESS[1]: 10.0.0.20/24 IP4.GATEWAY: -- IP4.ROUTE[1]: dst = 10.0.0.0/24, nh = 0.0.0.0, mt = 425 $ ip addr show br54 5: br54: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000     link/ether 6e:70:f7:76:39:67 brd ff:ff:ff:ff:ff:ff     inet 10.0.0.20/24 brd 10.0.0.255 scope global noprefixroute br54        valid_lft forever preferred_lft forever # Running a similar test through 'netplan-dbus' $ killall netplan-dbus $ env -u PATH /usr/lib/netplan/netplan-dbus & $ busctl call io.netplan.Netplan /io/netplan/Netplan io.netplan.Netplan Config o "/io/netplan/Netplan/config/UV0ID2" $ busctl call io.netplan.Netplan /io/netplan/Netplan/config/UV0ID2 io.netplan.Netplan.Config Try u 120 b true $ busctl call io.netplan.Netplan /io/netplan/Netplan/config/UV0ID2 io.netplan.Netplan.Config Apply b true => Make sure the 'netplan-dbus' binary did not crash. [ Where problems could occur ]  * Netplan is a core component, thus changing it bears a high risk  * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.  * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ]  * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)  * This has been fixed upstream in https://github.com/canonical/netplan/pull/336  * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working. [ Impact ]  * When using the netplan-dbus API on Ubuntu Core and the network-manager renderer (NM snap) the "netplan-dbus" application will crash. Leaving the device unreachable.  * Netplan's CLI is unable to find the network-manager.nmcli binary from the NetworkManager snap, as it's not in netplan-dbus's PATH (nor Python's default BINDIR), therefore it cannot properly restart NM's connections to re-activate the network after changes were applied. [ Test Plan ] ============================== Boot an Ubuntu Core 20 system, which this fix as part of the core20 base snap ============================== $ snap install network-manager --channel=20/stable $ nmcli # VERIFY br54 is not there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ==============================  Network/SSH connection will be interrupted briefly, but reconnect after some seconds. ============================== $ netplan get # VERIFY br54 is there network:   version: 2   renderer: NetworkManager   ethernets:     ens3:       dhcp4: true   bridges:     br54:       dhcp4: true $ sudo journalctl | grep FileNotFound # EMPTY => no errors $ nmcli # VERIFY br54 is there ens3: connected to netplan-ens3         "ens3"         ethernet (virtio_net), 52:54:00:12:34:56, hw, mtu 1500         ip4 default, ip6 default         inet4 10.0.2.15/24         route4 0.0.0.0/0         route4 10.0.2.0/24         inet6 fec0::5054:ff:fe12:3456/64         inet6 fe80::5054:ff:fe12:3456/64         route6 fe80::/64         route6 ::/0         route6 fec0::/64 br54: connecting (getting IP configuration) to netplan-br54         "br54"         bridge, 12:E6:74:FA:8A:75, sw, mtu 1500 lo: unmanaged         "lo"         loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 DNS configuration:         servers: 10.0.2.3         interface: ens3 [ Test Plan 2 "Classic" ] # Prepare environment with NetworkManager installed and the 'nmcli' binary moved to /snap/bin/nmcli (outside of PATH and outside of Python's default/fallback BINDIR). $ apt install network-manager $ mv /usr/bin/nmcli /snap/bin/nmcli $ netplan get network:   version: 2   ethernets:     eth0:       dhcp4: true $ netplan set network.renderer=NetworkManager # change global renderer to NM $ netplan set network.bridges.br54.addresses=[10.0.0.20/24] $ netplan get network:   version: 2   renderer: NetworkManager   ethernets:     eth0:       dhcp4: true   bridges:     br54:       addresses:       - "10.0.0.20/24" $ env -u PATH /usr/sbin/netplan try # Try-Apply the configuration => This should NOT crash! => Check that the "netplan-br54" connection is "connected" and the "br54" got created correctly with IP address 10.0.0.20/24: $ /snap/bin/nmcli d show br54 GENERAL.DEVICE: br54 GENERAL.TYPE: bridge GENERAL.HWADDR: 6E:70:F7:76:39:67 GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: netplan-br54 GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2 IP4.ADDRESS[1]: 10.0.0.20/24 IP4.GATEWAY: -- IP4.ROUTE[1]: dst = 10.0.0.0/24, nh = 0.0.0.0, mt = 425 $ ip addr show br54 5: br54: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000     link/ether 6e:70:f7:76:39:67 brd ff:ff:ff:ff:ff:ff     inet 10.0.0.20/24 brd 10.0.0.255 scope global noprefixroute br54        valid_lft forever preferred_lft forever # Running a similar test through 'netplan-dbus' $ killall netplan-dbus $ env -u PATH /usr/lib/netplan/netplan-dbus & $ busctl call io.netplan.Netplan /io/netplan/Netplan io.netplan.Netplan Config o "/io/netplan/Netplan/config/UV0ID2" $ busctl call io.netplan.Netplan /io/netplan/Netplan/config/UV0ID2 io.netplan.Netplan.Config Try u 120 b true $ busctl call io.netplan.Netplan /io/netplan/Netplan/config/UV0ID2 io.netplan.Netplan.Config Apply b true => Make sure the 'netplan-dbus' binary did not crash. [ Where problems could occur ]  * Netplan is a core component, thus changing it bears a high risk  * This upload modifies Netplan's CLI only, therefor the system boot-up and initial network connection should not be affect if anything goes wrong.  * Netplan's CLI could be affected, breaking the snapd integration (dbus-netplan) and CLI commands like "netplan apply" [ Other Info ]  * This is addressed in Jammy via bug #2025519 (SRU/backport of 0.106.1)  * This has been fixed upstream in https://github.com/canonical/netplan/pull/336  * A test PPA is available here: https://launchpad.net/~slyon/+archive/ubuntu/lp1959570 === original bug report === When using the netplan-dbus API on Ubuntu Core and the network-manager renderer the "netplan-dbus" appication will crash. To reproduce take a UC20 or UC22 system and run: ``` $ sudo snap set system system.network.netplan.network.bridges.br54.dhcp4=true ``` (which in effect just drives the dbus API of netplan). After that the network is lost. When manually restarting it the error is: ``` error: cannot perform the following tasks: - Run configure hook of "core" snap (run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/VDDSG1'.) ``` and the journal reports: ``` Jan 31 10:46:04 ubuntu sudo[1746]: mvo : TTY=pts/0 ; PWD=/home/mvo ; USER=root ; COMMAND=/usr/bin/snap set system system.network.netplan.network.bridges.br54.dhcp4=true Jan 31 10:46:04 ubuntu sudo[1746]: pam_unix(sudo:session): session opened for user root(uid=0) by mvo(uid=1000) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: During handling of the above exception, another exception occurred: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: Traceback (most recent call last): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/sbin/netplan", line 23, in <module> Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: netplan.main() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.run_command() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/utils.py", line 315, in run_command Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.func() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self.revert() Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 272, in command_apply Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: if b'\nconnected' in subprocess.check_output(cmd, env=env): Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 424, in check_output Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 505, in run Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: with Popen(*popenargs, **kwargs) as process: Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: self._execute_child(args, executable, preexec_fn, close_fds, Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: raise child_exception_type(errno_num, err_msg, err_filename) Jan 31 10:46:05 ubuntu io.netplan.Netplan[1763]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli' Jan 31 10:46:10 ubuntu io.netplan.Netplan[884]: 'netplan try' exited with status: 0 Jan 31 10:46:10 ubuntu snapd[605]: taskrunner.go:271: [change 13 "Run configure hook of \"core\" snap" task] failed: run hook "configure": cannot try netplan config: no specific reason returned from netplan and cannot cancel netplan config: Unknown object '/io/netplan/Netplan/config/LX32G1'. ``` The full journal log is attached. I guess it's a bit the question if this is a netplan or a nm-snap bug (it might need to provide an nmcli alias?). But in any case the crash and losing network is worth fixing regardless I think. Fwiw, I also suspect this is the issue that prevents my spread tests in https://github.com/snapcore/snapd/compare/master...mvo5:netplan-read-write-nm?expand=1 from working.
2023-11-21 10:23:10 Łukasz Zemczak netplan.io (Ubuntu Focal): status In Progress Fix Committed
2023-11-21 10:23:12 Łukasz Zemczak bug added subscriber SRU Verification
2023-11-21 10:23:15 Łukasz Zemczak tags foundations-todo fr-2041 sru-next foundations-todo fr-2041 sru-next verification-needed verification-needed-focal
2023-11-22 15:54:27 Lukas Märdian tags foundations-todo fr-2041 sru-next verification-needed verification-needed-focal foundations-todo fr-2041 sru-next verification-done-focal verification-needed
2023-11-28 23:22:15 Brian Murray removed subscriber Ubuntu Stable Release Updates Team
2023-11-28 23:22:16 Launchpad Janitor netplan.io (Ubuntu Focal): status Fix Committed Fix Released