Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1631349

Summary: Backport upstream change I98d56645df04a6d0c830428053553b8eeecf5747 | SQL syntax error on updating fixed_ips w/ an empty list
Product: Red Hat OpenStack Reporter: Irina Petrova <ipetrova>
Component: openstack-heatAssignee: Rabi Mishra <ramishra>
Status: CLOSED ERRATA QA Contact: Victor Voronkov <vvoronko>
Severity: medium Docs Contact:
Priority: medium    
Version: 10.0 (Newton)CC: dcadzow, mburns, ramishra, sbaker, shardy, therve, zbitter
Target Milestone: ---Keywords: FeatureBackport, Triaged, ZStream
Target Release: 10.0 (Newton)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-heat-7.0.6-5.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1632546 1636898 (view as bug list) Environment:
Last Closed: 2019-01-16 17:10:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1632546, 1636898    

Description Irina Petrova 2018-09-20 11:49:52 UTC
Description of problem:

As described in LP 1710833 and LP 1538473 there seems to be a problem with passing an empty list to update fixed_ips (or, in other words: to remove fixed_ips).

Can we have the patch(es) in downstream Newton, please.

From RHOSP-10 environment:

~~~~
48442 2018-09-04 13:48:59.473 37118 INFO neutron.wsgi [req-2d6992ab-1961-47bf-af9c-741590096424 b18eb82c5bae4f72b60bc4924d5b052c efd408062d9448058536a17999348195 - - -] 10.148.49.14 - - 
[04/Sep/2018 13:48:59] "PUT /v2.0/ports/855b9553-afc6-45fd-925b-85d83c48d206.json HTTP/1.1" 500 344 0.695959     

< snip >

48293 2018-09-04 13:48:59.468 37118 ERROR oslo_db.sqlalchemy.exc_filters [req-2d6992ab-1961-47bf-af9c-741590096424 b18eb82c5bae4f72b60bc4924d5b052c efd408062d9448058536a17999348195 - - -]
DBAPIError exception wrapped from (pymysql.err.ProgrammingError) (1064, u"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '}, 
vif_type='unbound', vif_details='' WHERE ml2_port_bindings.port_id = '855b955' at line 1") 
[SQL: u'UPDATE ml2_port_bindings SET vnic_type=%(vnic_type)s, vif_type=%(vif_type)s, vif_details=%(vif_details)s WHERE ml2_port_bindings.port_id = %(ml2_port_bindings_port_id)s'] 
[parameters: {'vnic_type': {}, 'ml2_port_bindings_port_id': u'855b9553-afc6-45fd-925b-85d83c48d206', 'vif_type': 'unbound', 'vif_details': ''}]

ERROR oslo_db.sqlalchemy.exc_filters Traceback (most recent call last):
ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
ERROR oslo_db.sqlalchemy.exc_filters     context)
ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
ERROR oslo_db.sqlalchemy.exc_filters     cursor.execute(statement, parameters)
ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line 166, in execute
ERROR oslo_db.sqlalchemy.exc_filters     result = self._query(query)
ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line 322, in _query
ERROR oslo_db.sqlalchemy.exc_filters     conn.query(q)
ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 841, in query
ERROR oslo_db.sqlalchemy.exc_filters     self._affected_rows = self._read_query_result(unbuffered=unbuffered)
ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 1029, in _read_query_result
ERROR oslo_db.sqlalchemy.exc_filters     result.read()
ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 1312, in read
ERROR oslo_db.sqlalchemy.exc_filters     first_packet = self.connection._read_packet()
ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 991, in _read_packet
ERROR oslo_db.sqlalchemy.exc_filters     packet.check_error()
ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 393, in check_error
ERROR oslo_db.sqlalchemy.exc_filters     err.raise_mysql_exception(self._data)
ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
ERROR oslo_db.sqlalchemy.exc_filters     raise errorclass(errno, errval)
ERROR oslo_db.sqlalchemy.exc_filters ProgrammingError: (1064, u"You have an error in your SQL syntax; 
                                                                         check the manual that corresponds to your MariaDB server version for the right syntax to use near '}, 
                                                                         vif_type='unbound', vif_details='' WHERE ml2_port_bindings.port_id = '855b955' at line 1")

ERROR neutron.api.v2.resource [req-2d6992ab-1961-47bf-af9c-741590096424 b18eb82c5bae4f72b60bc4924d5b052c efd408062d9448058536a17999348195 - - -] update failed: No details.                               
ERROR neutron.api.v2.resource Traceback (most recent call last):
ERROR neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/v2/resource.py", line 93, in resource
ERROR neutron.api.v2.resource     result = method(request=request, **args)
ERROR neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/v2/base.py", line 605, in update
ERROR neutron.api.v2.resource     return self._update(request, id, body, **kwargs)
ERROR neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/api.py", line 88, in wrapped
ERROR neutron.api.v2.resource     setattr(e, '_RETRY_EXCEEDED', True)
ERROR neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
ERROR neutron.api.v2.resource     self.force_reraise()

< snip >

ERROR neutron.api.v2.resource     err.raise_mysql_exception(self._data)
ERROR neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
ERROR neutron.api.v2.resource     raise errorclass(errno, errval)
ERROR neutron.api.v2.resource DBError: (pymysql.err.ProgrammingError) (1064, u"You have an error in your SQL syntax; 
                                                                  check the manual that corresponds to your MariaDB server version for the right syntax to use near '}, 
                                                                  vif_type='unbound', vif_details='' WHERE ml2_port_bindings.port_id = '855b955' at line 1") 
                        [SQL: u'UPDATE ml2_port_bindings SET vnic_type=%(vnic_type)s, vif_type=%(vif_type)s, vif_details=%(vif_details)s WHERE ml2_port_bindings.port_id = %(ml2_port_bindings_port_id)s'] 
                        [parameters: {'vnic_type': {}, 'ml2_port_bindings_port_id': u'855b9553-afc6-45fd-925b-85d83c48d206', 'vif_type': 'unbound', 'vif_details': ''}]

48441 2018-09-04 13:48:59.470 37118 ERROR neutron.api.v2.resource
48442 2018-09-04 13:48:59.473 37118 INFO neutron.wsgi [req-2d6992ab-1961-47bf-af9c-741590096424 b18eb82c5bae4f72b60bc4924d5b052c efd408062d9448058536a17999348195 - - -] 10.148.49.14 - - 
[04/Sep/2018 13:48:59] "PUT /v2.0/ports/855b9553-afc6-45fd-925b-85d83c48d206.json HTTP/1.1" 500 344 0.695959                                                                                                    
~~~~


Version-Release number of selected component (if applicable):
RHOSP-10

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
Fixed IPs are not getting updated/removed.

Expected results:
Fixed IPs are successfully removed upon a heat stack update.

Additional info:

Comment 2 Irina Petrova 2018-10-25 17:54:53 UTC
Guys, any progress on the backport to RHOSP-10/Newton? :)

Comment 13 errata-xmlrpc 2019-01-16 17:10:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0076