Unable to associate FIP with Tungstenfabric Neutron backend

Bug #2008132 reported by Vadym Markov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
In Progress
Undecided
Unassigned

Bug Description

Reproduced issue on the environment with TF Neutron backend and enabled 'enable_fip_topology_check' config option. OVN backend is not affected in any case, combination of any Neutron backend and disabled 'enable_fip_topology_check' also not affected.

It is possible to remove all FIPs from port via CLI at the TF environment. In case of enabled topology check it leads to error during FIP associate and disassociate operations.

Sample of traceback:

2023-01-12 11:23:41.841408 File "/var/lib/openstack/lib/python3.8/site-packages/openstack_dashboard/dashboards/project/instances/forms.py", line 436
, in __init__
2023-01-12 11:23:41.841412 targets = api.neutron.floating_ip_target_list_by_instance(
2023-01-12 11:23:41.841415 File "/var/lib/openstack/lib/python3.8/site-packages/openstack_dashboard/api/neutron.py", line 1631, in floating_ip_targe
t_list_by_instance
2023-01-12 11:23:41.841419 return FloatingIpManager(request).list_targets_by_instance(
2023-01-12 11:23:41.841425 File "/var/lib/openstack/lib/python3.8/site-packages/openstack_dashboard/api/neutron.py", line 757, in list_targets_by_in
stance
2023-01-12 11:23:41.841429 reachable_subnets = self._get_reachable_subnets(
2023-01-12 11:23:41.841433 File "/var/lib/openstack/lib/python3.8/site-packages/openstack_dashboard/api/neutron.py", line 690, in _get_reachable_sub
nets
2023-01-12 11:23:41.841436 reachable_subnets = set(p.fixed_ips[0]['subnet_id']
2023-01-12 11:23:41.841440 File "/var/lib/openstack/lib/python3.8/site-packages/openstack_dashboard/api/neutron.py", line 690, in <genexpr>
2023-01-12 11:23:41.841444 reachable_subnets = set(p.fixed_ips[0]['subnet_id']
2023-01-12 11:23:41.841446 IndexError: list index out of range

It leads to "Error occured" popup alert at the dashboard and reload of Instances page.

It would be great to catch this error and provide user more reasonable message

Changed in horizon:
status: New → In Progress
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Which operation raises IndexError?

According to the bug description, it seems [1] raises an exception.
I think "[0]" operation is the only operation which can raise IndexError.
However, we have the same operation at [2] (for a case where enable_fip_topology_check == False).

The proposed patch https://review.opendev.org/c/openstack/horizon/+/873623 tries to add an error message which suggests enable_fip_topology_check == False, but I wonder the same error can happen.

Could your provide more detail context when this error happens?
Especially I would like to know the contents of "router_ports".
I wonder some port does not have an IP addresses (because this is the only case I know where fixed_ips attribute is empty).

[1] https://github.com/openstack/horizon/blob/5663e0865b458fc67005049e68bc4ef73786e495/openstack_dashboard/api/neutron.py#L806-L808
[2] https://github.com/openstack/horizon/blob/5663e0865b458fc67005049e68bc4ef73786e495/openstack_dashboard/api/neutron.py#L792

Revision history for this message
Vadym Markov (vmarkov) wrote :

[1] is related to the issue.

Yes, prerequisite is port with removed fixed IP and present in router_ports . I think such state is impossible for the OVN backend, but it is valid for TF.

Sample of router_ports from the affected live environment:

router_ports[1]
<Port: {'allowed_address_pairs': [], 'updated_at': '2023-06-16T17:14:31.343167', 'device_owner': 'network:router_interface', 'port_security_enabled': True, 'fixed_ips': [], 'id': 'a13724be-d67c-4ee9-9554-fcb13f75ca3f', 'security_groups': ['8819e2db-5e73-4c5b-bc60-9ffabf7d6803'], 'binding:vif_details': {'port_filter': True}, 'binding:vif_type': 'unbound', 'mac_address': '02:a1:37:24:be:d6', 'project_id': '23c8f76723db4150be7435ac813a94c2', 'status': 'ACTIVE', 'binding:host_id': None, 'description': '', 'device_id': 'cc18c46b-5670-4042-8bc4-f2452b16a4bb', 'name': 'port_1', 'admin_state_up': True, 'network_id': '02c906e3-6cdf-4ea5-b9d3-ac7e7506ba94', 'tenant_id': '23c8f76723db4150be7435ac813a94c2', 'created_at': '2023-06-16T17:14:18.050524', 'binding:vnic_type': 'normal', 'admin_state': 'UP', 'binding__vif_details': {'port_filter': True}, 'binding__vif_type': 'unbound', 'binding__host_id': None, 'binding__vnic_type': 'normal'}>

To achieve such state, we need to create router with enabled external gateway and attached port, and then remove fixed ip from this port

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.