Bug 2186758 - trying to remove a tenant port associated to a FIP by admin fails with resultCode: 500
Summary: trying to remove a tenant port associated to a FIP by admin fails with result...
Keywords:
Status: POST
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-neutron
Version: 16.2 (Train)
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: z6
: 16.2 (Train on RHEL 8.4)
Assignee: Fernando Royo
QA Contact: Eran Kuris
URL:
Whiteboard:
Depends On:
Blocks: 2193412
TreeView+ depends on / blocked
 
Reported: 2023-04-14 10:53 UTC by rlobillo
Modified: 2023-07-06 14:15 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2193412 (view as bug list)
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
egressip_test.yaml (904 bytes, text/plain)
2023-04-14 10:53 UTC, rlobillo
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Launchpad 2017680 0 None None None 2023-04-25 15:23:23 UTC
OpenStack gerrit 881827 0 None MERGED Return 409 Conflict to tenant user deleting port attached to FIP 2023-07-11 06:53:35 UTC
Red Hat Issue Tracker OSP-24192 0 None None None 2023-04-14 10:53:51 UTC

Description rlobillo 2023-04-14 10:53:09 UTC
Created attachment 1957464 [details]
egressip_test.yaml

Created attachment 1957464 [details]
egressip_test.yaml

Description of problem:
While running egressIP feature testing for OCP on OSP, below issue is observed: A port linked to a FIP by admin user cannot be deleted but neutron is answering with resultCode 500 (internal server error). A more accurante resultCode should be provided so Openshift can handle the error accordingly.

2023-04-14 10:01:49.061 277 DEBUG neutron.plugins.ml2.plugin [req-f7246ff0-bcde-4211-84d8-1a34283ca3fb 56fabeda93e4441f8dae35f7fe5996d0 01164c5f6ddb446b90a90f49bf114732 - default default] Calling delete_port for f6e7df2b-3a4f-49e5-ac0b-c07860302d08 owned by OpenShiftEgressIP delete_port /usr/lib/python3.6/site-packages/neutron/plugins/ml2/plugin.py:1997
2023-04-14 10:01:49.077 274 DEBUG neutron.wsgi [-] (274) accepted ('172.17.1.89', 39894) server /usr/lib/python3.6/site-packages/eventlet/wsgi.py:985
2023-04-14 10:01:49.082 274 INFO neutron.wsgi [-] 172.17.1.89 "OPTIONS / HTTP/1.0" status: 200  len: 249 time: 0.0035684
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation [req-f7246ff0-bcde-4211-84d8-1a34283ca3fb 56fabeda93e4441f8dae35f7fe5996d0 01164c5f6ddb446b90a90f49bf114732 - default default] DELETE failed.: oslo_db.exception.DBReferenceError: (pymysql.err.IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`ovs_neutron`.`floatingips`, CONSTRAINT `floatingips_ibfk_1` FOREIGN KEY (`fixed_port_id`) REFERENCES `ports` (`id`))')
[SQL: DELETE FROM ports WHERE ports.id = %(id)s]
[parameters: {'id': 'f6e7df2b-3a4f-49e5-ac0b-c07860302d08'}]
(Background on this error at: http://sqlalche.me/e/gkpj)
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation Traceback (most recent call last):
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation     cursor, statement, parameters, context
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib64/python3.6/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation     cursor.execute(statement, parameters)
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python3.6/site-packages/pymysql/cursors.py", line 163, in execute
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation     result = self._query(query)
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python3.6/site-packages/pymysql/cursors.py", line 321, in _query
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation     conn.query(q)
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python3.6/site-packages/pymysql/connections.py", line 505, in query
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation     self._affected_rows = self._read_query_result(unbuffered=unbuffered)
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python3.6/site-packages/pymysql/connections.py", line 724, in _read_query_result
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation     result.read()
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python3.6/site-packages/pymysql/connections.py", line 1069, in read
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation     first_packet = self.connection._read_packet()
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python3.6/site-packages/pymysql/connections.py", line 676, in _read_packet
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation     packet.raise_for_error()
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python3.6/site-packages/pymysql/protocol.py", line 223, in raise_for_error
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation     err.raise_mysql_exception(self._data)
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation   File "/usr/lib/python3.6/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation     raise errorclass(errno, errval)
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation pymysql.err.IntegrityError: (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`ovs_neutron`.`floatingips`, CONSTRAINT `floatingips_ibfk_1` FOREIGN KEY (`fixed_port_id`) REFERENCES `ports` (`id`))')
2023-04-14 10:01:49.116 277 ERROR neutron.pecan_wsgi.hooks.translation



Version-Release number of selected component (if applicable):
RHOS-16.2-RHEL-8-20220804.n.1
4.13.0-0.nightly-2023-04-13-171034

How reproducible: Always

Steps to Reproduce:
1. Create an egressIP in Openshift on Openstack
2. Associate the egressIP to a FIP which admin credentials
3. Destroy the egressIP
Steps are automated on a script linked as a private command.

Actual results:
Neutron responds with resultCode 500 everytime OCP tries to remove the port.

Expected results:
more accurante result code should be provided to openshift so it can handle the error accordingly.

Additional info:
Documented on Openshift side on https://issues.redhat.com/browse/OCPBUGS-5244


Note You need to log in before you can comment on or make changes to this bug.