Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply: Fix crash when OVS is stopped (LP#1995598) #307

Merged
merged 3 commits into from
Jan 19, 2023

Conversation

daniloegea
Copy link
Contributor

@daniloegea daniloegea commented Jan 4, 2023

If openvswitch is installed but not running, netplan apply will try to call the service anyway and will crash. In this case we probably should ignore the error and log a warning message to the user.

Add an integration test that will be executed by autopkgtest.

Description

It addresses https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1995598

The problem can be reproduced with:

lxc launch ubuntu:22.04 jammy --vm
lxc exec jammy bash
apt install openvswitch-switch
systemctl stop ovsdb-server
netplan apply

Checklist

  • Runs make check successfully.
  • Retains 100% code coverage (make check-coverage).
  • New/changed keys in YAML format are documented.
  • (Optional) Adds example YAML for new feature.
  • (Optional) Closes an open bug in Launchpad.

If openvswitch is installed but not running, netplan apply will try to
call the service anyway and will crash. In this case we probably should
ignore the error and log a warning message to the user.

Add an integration test that will be executed by autopkgtest.
@daniloegea daniloegea requested a review from slyon January 11, 2023 16:28
OPENVSWITCH_OVS_VSCTL = '/usr/bin/ovs-vsctl'
OPENVSWITCH_OVSDB_SERVER_UNIT = 'ovsdb-server'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's call it ovsdb-server.service explicitly

Copy link
Collaborator

@slyon slyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, lgtm!
I added some small bit to call ovsdb-server.service by its explicit name (including the .service suffix). Let's merge it once it passes the tests.

@slyon slyon merged commit 45b25f6 into canonical:main Jan 19, 2023
@ali-basafa
Copy link

This error is because ovsdb-server.service is not running, and if it is not running, you can install it with
apt-get install openvswitch-switch
systemctl restart ovsdb-server
, and if it is installed, remove it and install it again with the following command.
apt-get remove openvswitch-switch
apt-get install openvswitch-switch
systemctl restart ovsdb-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants