dbus Try command fails on UC while trying to run nmcli

Bug #2026819 reported by Alfonso Sanchez-Beato
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
New
Undecided
Unassigned

Bug Description

On Ubuntu Core, with the network-manager snap installed, Try fails when trying to modify a NM connection:

ubuntu@ubuntu:~$ sudo busctl call io.netplan.Netplan /io/netplan/Netplan io.netplan.Netplan Config
o "/io/netplan/Netplan/config/X6QL71"

ubuntu@ubuntu:~$ sudo busctl call io.netplan.Netplan /io/netplan/Netplan/config/X6QL71 io.netplan.Netplan.Config Set ss network.modems.NM-44806e5e-1a4c-4ac7-b8eb-c7c9bcf5dc70.apn=yyyyyy.com ""
b true

ubuntu@ubuntu:~$ sudo busctl call io.netplan.Netplan /io/netplan/Netplan/config/X6QL71 io.netplan.Netplan.Config Try u 0
b false

Config object disappears after this failure:
ubuntu@ubuntu:~$ sudo busctl call io.netplan.Netplan /io/netplan/Netplan/config/X6QL71 io.netplan.Netplan.Config Get
Call failed: Unknown object '/io/netplan/Netplan/config/X6QL71'.

Journal reveals that it cannot find nmcli:

Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: Traceback (most recent call last):
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 99, in command_try
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False, state_dir=self.state)
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 287, in command_apply
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: if b'\nconnected' in subprocess.check_output(cmd, env=env):
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/lib/python3.10/subprocess.py", line 501, in run
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: with Popen(*popenargs, **kwargs) as process:
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: self._execute_child(args, executable, preexec_fn, close_fds,
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: raise child_exception_type(errno_num, err_msg, err_filename)
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli'
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: During handling of the above exception, another exception occurred:
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: Traceback (most recent call last):
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/sbin/netplan", line 23, in <module>
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: netplan.main()
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: self.run_command()
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/share/netplan/netplan/cli/utils.py", line 247, in run_command
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: self.func()
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 81, in run
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: self.run_command()
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/share/netplan/netplan/cli/utils.py", line 247, in run_command
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: self.func()
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 113, in command_try
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: self.revert()
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 143, in revert
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: NetplanApply().command_apply(run_generate=False, sync=True, exit_on_error=False, state_dir=tempdir)
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/share/netplan/netplan/cli/commands/apply.py", line 287, in command_apply
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: if b'\nconnected' in subprocess.check_output(cmd, env=env):
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/lib/python3.10/subprocess.py", line 501, in run
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: with Popen(*popenargs, **kwargs) as process:
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: self._execute_child(args, executable, preexec_fn, close_fds,
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: raise child_exception_type(errno_num, err_msg, err_filename)
Jul 11 09:16:21 ubuntu io.netplan.Netplan[2413]: FileNotFoundError: [Errno 2] No such file or directory: 'nmcli'

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Running Apply works, but the ethernet connection is somewhat dropped and a netplan apply is required to get it back:

ubuntu@ubuntu:~$ sudo busctl call io.netplan.Netplan /io/netplan/Netplan io.netplan.Netplan Config
o "/io/netplan/Netplan/config/BWKZ71"
ubuntu@ubuntu:~$ sudo busctl call io.netplan.Netplan /io/netplan/Netplan/config/BWKZ71 io.netplan.Netplan.Config Set ss network.modems.NM-44806e5e-1a4c-4ac7-b8eb-c7c9bcf5dc70.apn=gggggg.com ""
b true
ubuntu@ubuntu:~$ sudo busctl call io.netplan.Netplan /io/netplan/Netplan/config/BWKZ71 io.netplan.Netplan.Config Apply
b true
ubuntu@ubuntu:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
ubuntu@ubuntu:~$ sudo netplan apply
ubuntu@ubuntu:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute ens3
       valid_lft 86399sec preferred_lft 86399sec
    inet6 fec0::9c6f:c7cd:f8ab:a83b/64 scope site temporary tentative dynamic
       valid_lft 86400sec preferred_lft 14400sec
    inet6 fec0::5054:ff:fe12:3456/64 scope site tentative dynamic mngtmpaddr
       valid_lft 86400sec preferred_lft 14400sec
    inet6 fe80::5054:ff:fe12:3456/64 scope link
       valid_lft forever preferred_lft forever

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

This might be a duplicate of bug #1959570

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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