Score:0

Stopping openvswitch-switch service breaks netplan

cn flag

I upgraded my system to Jammy Jellyfish 22.04 last week. Now when I try to systemctl stop openvswitch-switch the command stopes openvswitch (expected). But in doing so it breaks netplan.

So with openvswitch stopped, if I try to make a change to netplan and do a sudo netplan apply I get this error:

# sudo netplan apply
ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (No such file or directory)
Traceback (most recent call last):
  File "/usr/sbin/netplan", line 23, in <module>
    netplan.main()
  File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 247, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 61, in run
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 247, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 167, in command_apply
    NetplanApply.process_ovs_cleanup(config_manager, old_files_ovs, restart_ovs, exit_on_error)
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 394, in process_ovs_cleanup
    apply_ovs_cleanup(config_manager, ovs_old, ovs_current)
  File "/usr/share/netplan/netplan/cli/ovs.py", line 138, in apply_ovs_cleanup
    out = subprocess.check_output([OPENVSWITCH_OVS_VSCTL, '--columns=name,external-ids',
  File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/ovs-vsctl', '--columns=name,external-ids', '-f', 'csv', '-d', 'bare', '--no-headings', 'list', 'Port']' returned non-zero exit status 1.

Here are the versions installed (I did dpdk installed)

# sudo apt list | grep openvswitch

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

neutron-openvswitch-agent/jammy-updates 2:20.2.0-0ubuntu1 all
openvswitch-common/jammy-updates,now 2.17.2-0ubuntu0.22.04.2 amd64 [installed,automatic]
openvswitch-dbg/jammy-updates 2.17.2-0ubuntu0.22.04.2 amd64
openvswitch-doc/jammy-updates 2.17.2-0ubuntu0.22.04.2 all
openvswitch-ipsec/jammy-updates 2.17.2-0ubuntu0.22.04.2 amd64
openvswitch-pki/jammy-updates 2.17.2-0ubuntu0.22.04.2 all
openvswitch-source/jammy-updates 2.17.2-0ubuntu0.22.04.2 all
openvswitch-switch-dpdk/jammy-updates,now 2.17.2-0ubuntu0.22.04.2 amd64 [installed]
openvswitch-switch/jammy-updates,now 2.17.2-0ubuntu0.22.04.2 amd64 [installed,automatic]
openvswitch-test/jammy-updates 2.17.2-0ubuntu0.22.04.2 all
openvswitch-testcontroller/jammy-updates 2.17.2-0ubuntu0.22.04.2 amd64
openvswitch-vtep/jammy-updates 2.17.2-0ubuntu0.22.04.2 amd64
python3-openvswitch/jammy-updates,now 2.17.2-0ubuntu0.22.04.2 all [installed,automatic]

Anyone know how to fix netplan so it keeps working when openvswitch it stopped?

Danilo Egea Gondolfo avatar
aq flag
Thanks for reporting it. Do you have any netplan configuration in /etc/netplan related to openvswitch? If you are not using netplan to manage openvswitch configuration, removing it from your yaml files should be a workaround for now. I will create a bug report for it.
Dave avatar
cn flag
I do not manage open switch from netplan at all. Did you want me to share my netplan configuration? If so I can update my post.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.