sunbeam configure allows invalid interface name

Bug #2068629 reported by Andre Ruiz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Snap
New
Undecided
Unassigned

Bug Description

When installing sunbeam I have given an non-existing interface name as the OVN network interface in the manifest file, and later I got the error:

09:46:29 > Applying local hypervisor settings ... setting hypervisor configuration for sunbeam11.mydomain
09:46:33 An unexpected error has occurred. Please run 'sunbeam inspect' to generate an inspection report.
09:46:33 Error: {'return-code': 1, 'stderr': 'error: snap "openstack-hypervisor" has no "network.external-nic" configuration\n option\nerror: cannot perform the following tasks:\n- Run configure hook of "openstack-hypervisor" snap (run hook "configure": \n-----\nTraceback (most recent call last):\n File "/snap/openstack-hypervisor/150/snap/hooks/configure", line 9, in <module>\n sys.exit(configure(Snap()))\n File "/snap/openstack-hypervisor/150/lib/python3.10/site-packages/openstack_hypervisor/hooks.py", line 1287, in configure\n _configure_ovn_external_networking(snap)\n File "/snap/openstack-hypervisor/150/lib/python3.10/site-packages/openstack_hypervisor/hooks.py", line 798, in _configure_ovn_external_networking\n _ensure_link_up(external_nic)\n File "/snap/openstack-hypervisor/150/lib/python3.10/site-packages/openstack_hypervisor/hooks.py", line 851, in _ensure_link_up\n dev = ipr.link_lookup(ifname=interface)[0]\nIndexError: list index out of range\n-----)\nUncaught SnapError in charm code: Snap: \'openstack-hypervisor\'; command [\'snap\', \'set\', \'openstack-hypervisor\', \'-t\', \'network.external-nic="bond0.1001"\'] failed with output = \'\'\nUse `juju debug-log` to see the full traceback.\n'}
09:46:33 DEBUG: execute return code is 1

Seems like this should be caught at the beginning (a check for the interface name should be done when processing the manifest or interactively asking for the interface name) to avoid this error much later in the process.

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.