← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1896563] Re: Floating IP port forwarding rule update external_ Port, HTTP return code 500 error

 

Neutron had covered such issue [1][2][3]. 
[1] https://github.com/openstack/neutron/blob/master/neutron/services/portforwarding/pf_plugin.py#L433-L439
[2] https://github.com/openstack/neutron/blob/master/neutron/db/migration/alembic_migrations/versions/rocky/expand/867d39095bf4_port_forwarding.py#L58
[3] https://github.com/openstack/neutron/blob/master/neutron/db/migration/alembic_migrations/versions/stein/expand/d72db3e25539_modify_uniq_port_forwarding.py

** Changed in: neutron
       Status: In Progress => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1896563

Title:
  Floating IP port forwarding rule update external_ Port, HTTP return
  code 500 error

Status in neutron:
  Invalid

Bug description:
    When an existing port forwarding rule is updated on the floating IP, if the external_port field contained in the updated content is the same as that in other port forwarding rule entries under the floating IP, the HTTP return code is 500;
    The log of the neutron server is as follows:
  2020-09-22 11:01:28.779 24 ERROR oslo_db.api 
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource [req-6d482405-6141-444a-96dc-00dc3377be26 3b68afd339ef43ed97c1e5b145a3961b 4bf85834786143a28c75239bd52add52 - default default] update failed: No details.: DBDuplicateEntry: (pymysql.err.IntegrityError) (1062, u"Duplicate entry '65f3ec87-b937-4485-a205-e4946acbf745-77' for key 'uniq_port_forwardings0floatingip_id0external_port'") [SQL: u'UPDATE portforwardings SET external_port=%(external_port)s WHERE portforwardings.id = %(portforwardings_id)s'] [parameters: {'external_port': 77, 'portforwardings_id': u'622041f5-981a-4cef-bd27-c5009c419572'}] (Background on this error at: http://sqlalche.me/e/gkpj)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource Traceback (most recent call last):
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron/api/v2/resource.py", line 98, in resource
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     result = method(request=request, **args)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron/api/v2/base.py", line 626, in update
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     return self._update(request, id, body, **kwargs)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron_lib/db/api.py", line 140, in wrapped
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     setattr(e, '_RETRY_EXCEEDED', True)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     self.force_reraise()
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron_lib/db/api.py", line 136, in wrapped
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     return f(*args, **kwargs)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_db/api.py", line 154, in wrapper
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     ectxt.value = e.inner_exc
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     self.force_reraise()
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_db/api.py", line 142, in wrapper
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     return f(*args, **kwargs)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron_lib/db/api.py", line 183, in wrapped
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     LOG.debug("Retry wrapper got retriable exception: %s", e)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     self.force_reraise()
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron_lib/db/api.py", line 179, in wrapped
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     return f(*dup_args, **dup_kwargs)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron/api/v2/base.py", line 682, in _update
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     obj = obj_updater(request.context, id, **kwargs)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron/db/db_base_plugin_common.py", line 49, in inner
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     result = f(*args, **kwargs)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron/services/portforwarding/pf_plugin.py", line 360, in update_floatingip_port_forwarding
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     pf_obj.internal_port
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron/objects/base.py", line 314, in decorator
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     return func(self, *args, **kwargs)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron/objects/base.py", line 807, in update
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     self, self.obj_context,
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/neutron/objects/db/api.py", line 82, in update_object
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     db_obj.save(session=context.session)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_db/sqlalchemy/models.py", line 50, in save
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     session.flush()
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2254, in flush
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     self._flush(objects)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2380, in _flush
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     transaction.rollback(_capture_exception=True)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     compat.reraise(exc_type, exc_value, exc_tb)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2344, in _flush
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     flush_context.execute()
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 391, in execute
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     rec.execute(self)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 556, in execute
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     uow
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 177, in save_obj
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     mapper, table, update)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 768, in _emit_update_statements
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     execute(statement, multiparams)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 948, in execute
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     return meth(self, multiparams, params)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     return connection._execute_clauseelement(self, multiparams, params)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     compiled_sql, distilled_params
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     context)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1409, in _handle_dbapi_exception
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     util.raise_from_cause(newraise, exc_info)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 265, in raise_from_cause
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     reraise(type(exception), exception, tb=exc_tb, cause=cause)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     context)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 509, in do_execute
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     cursor.execute(statement, parameters)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/pymysql/cursors.py", line 170, in execute
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     result = self._query(query)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/pymysql/cursors.py", line 328, in _query
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     conn.query(q)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/pymysql/connections.py", line 516, in query
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/pymysql/connections.py", line 727, in _read_query_result
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     result.read()
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/pymysql/connections.py", line 1066, in read
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     first_packet = self.connection._read_packet()
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/pymysql/connections.py", line 683, in _read_packet
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     packet.check_error()
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/pymysql/protocol.py", line 220, in check_error
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     err.raise_mysql_exception(self._data)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource   File "/var/lib/kolla/venv/lib/python2.7/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource     raise errorclass(errno, errval)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource DBDuplicateEntry: (pymysql.err.IntegrityError) (1062, u"Duplicate entry '65f3ec87-b937-4485-a205-e4946acbf745-77' for key 'uniq_port_forwardings0floatingip_id0external_port'") [SQL: u'UPDATE portforwardings SET external_port=%(external_port)s WHERE portforwardings.id = %(portforwardings_id)s'] [parameters: {'external_port': 77, 'portforwardings_id': u'622041f5-981a-4cef-bd27-c5009c419572'}] (Background on this error at: http://sqlalche.me/e/gkpj)
  2020-09-22 11:01:28.782 24 ERROR neutron.api.v2.resource 
  2020-09-22 11:01:28.785 24 INFO neutron.wsgi [req-6d482405-6141-444a-96dc-00dc3377be26 3b68afd339ef43ed97c1e5b145a3961b 4bf85834786143a28c75239bd52add52 - default default] 10.180.205.242 "PUT /v2.0/floatingips/65f3ec87-b937-4485-a205-e4946acbf745/port_forwardings/622041f5-981a-4cef-bd27-c5009c419572 HTTP/1.1" status: 500  len: 368 time: 50.6874111
  2020-09-22 11:02:17.283 24 INFO neutron.wsgi [req-96a8b974

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1896563/+subscriptions


References