yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #70083
[Bug 1739571] [NEW] Can't delete root resource provider because of the self foreign key
Public bug reported:
Description
===========
Current, we can't delete the root resource provider record
because it has a foreign key reference it id on itself, we will
get back DBReferenceError, the reason is "Cannot delete or
update a parent row: a foreign key constraint fails".
NOTE: it is a essential case(just create and delete), but it doesn't be
triggered in test case because SQLLite allow us to delete it, but we
found this error in MYSQL database.
Steps to reproduce
==================
1. First create a resource provider without parent uuid.
curl -X POST http://10.76.6.31/placement/resource_providers -H "X-Auth-Token: $TOKEN" -H "OpenStack-API-Version: placement 1.15" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"name": "rp1", "uuid": "7d2590ae-9999-4080-9306-058b4c915e32"}'
We fill the id as it default the root_provider_uuid, code as below:
https://github.com/openstack/nova/blob/76dfdfc1ad8c0e5376bd997e45f65bec9ff53d12/nova/objects/resource_provider.py#L802-L809
2. Ensure it has been created.
curl -X GET http://10.76.6.31/placement/resource_providers/7d2590ae-9999-4080-9306-058b4c915e32 -H "X-Auth-Token: $TOKEN" -H "OpenStack-API-Version: placement 1.15" -H "Accept: application/json"
3. Try delete it
curl -X DELETE http://10.76.6.31/placement/resource_providers/7d2590ae-9999-4080-9306-058b4c915e32 -H "X-Auth-Token: $TOKEN" -H "OpenStack-API-Version: placement 1.15" -H "Accept: application/json"
yea, we can't delete it, and get back 500 ERROR: {"computeFault":
{"message": "The server has either erred or is incapable of performing
the requested operation.", "code": 500}}
Logs & Traceback
==============
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack [req-9975de8b-6784-4555-981c-fb57314535bc admin admin] Caught error: (pymysql.err.IntegrityError) (1451, u'Cannot delete or update a parent row: a foreign key constraint fails (`nova_api`.`resource_providers`, CONSTRAINT `resource_providers_ibfk_1` FOREIGN KEY (`root_provider_id`) REFERENCES `resource_providers` (`id`))') [SQL: u'DELETE FROM resource_providers WHERE resource_providers.id = %(id_1)s'] [parameters: {u'id_1': 3}]: DBReferenceError: (pymysql.err.IntegrityError) (1451, u'Cannot delete or update a parent row: a foreign key constraint fails (`nova_api`.`resource_providers`, CONSTRAINT `resource_providers_ibfk_1` FOREIGN KEY (`root_provider_id`) REFERENCES `resource_providers` (`id`))') [SQL: u'DELETE FROM resource_providers WHERE resource_providers.id = %(id_1)s'] [parameters: {u'id_1': 3}]
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack Traceback (most recent call last):
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/api/openstack/__init__.py", line 82, in __call__
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return req.get_response(self.application)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1327, in send
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack application, catch_exc_info=False)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1291, in call_application
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack app_iter = application(self.environ, start_response)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 131, in __call__
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 196, in call_func
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return self.func(req, *args, **kwargs)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/api/openstack/placement/microversion.py", line 117, in __call__
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack response = req.get_response(self.application)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1327, in send
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack application, catch_exc_info=False)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1291, in call_application
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack app_iter = application(self.environ, start_response)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/api/openstack/placement/handler.py", line 220, in __call__
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return dispatch(environ, start_response, self._map)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/api/openstack/placement/handler.py", line 147, in dispatch
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return handler(environ, start_response)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 131, in __call__
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/api/openstack/placement/wsgi_wrapper.py", line 29, in call_func
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack super(PlacementWsgify, self).call_func(req, *args, **kwargs)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 196, in call_func
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return self.func(req, *args, **kwargs)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/api/openstack/placement/handlers/resource_provider.py", line 208, in delete_resource_provider
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack resource_provider.destroy()
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/objects/resource_provider.py", line 688, in destroy
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack self._delete(self._context, self.id)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py", line 984, in wrapper
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return fn(*args, **kwargs)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/objects/resource_provider.py", line 845, in _delete
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack delete(synchronize_session=False)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 3212, in delete
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack delete_op.exec_()
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 1179, in exec_
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack self._do_exec()
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 1363, in _do_exec
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack mapper=self.mapper)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1154, in execute
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack bind, close_with_result=True).execute(clause, params or {})
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 945, in execute
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return meth(self, multiparams, params)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return connection._execute_clauseelement(self, multiparams, params)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack compiled_sql, distilled_params
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack context)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1398, in _handle_dbapi_exception
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack util.raise_from_cause(newraise, exc_info)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack reraise(type(exception), exception, tb=exc_tb, cause=cause)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack context)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 470, in do_execute
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack cursor.execute(statement, parameters)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/cursors.py", line 166, in execute
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack result = self._query(query)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/cursors.py", line 322, in _query
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack conn.query(q)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 856, in query
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack self._affected_rows = self._read_query_result(unbuffered=unbuffered)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 1057, in _read_query_result
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack result.read()
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 1340, in read
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack first_packet = self.connection._read_packet()
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 1014, in _read_packet
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack packet.check_error()
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 393, in check_error
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack err.raise_mysql_exception(self._data)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/err.py", line 107, in raise_mysql_exception
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack raise errorclass(errno, errval)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack DBReferenceError: (pymysql.err.IntegrityError) (1451, u'Cannot delete or update a parent row: a foreign key constraint fails (`nova_api`.`resource_providers`, CONSTRAINT `resource_providers_ibfk_1` FOREIGN KEY (`root_provider_id`) REFERENCES `resource_providers` (`id`))') [SQL: u'DELETE FROM resource_providers WHERE resource_providers.id = %(id_1)s'] [parameters: {u'id_1': 3}]
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack
2017-12-21 01:14:12.030 23740 INFO nova.api.openstack [req-9975de8b-6784-4555-981c-fb57314535bc admin admin] http://10.76.6.31/placement/resource_providers/7d2590ae-fb85-4080-9306-058b4c915e31 returned with HTTP 500
2017-12-21 01:14:12.110 23740 DEBUG nova.api.openstack.wsgi [req-9975de8b-6784-4555-981c-fb57314535bc admin admin] Returning 500 to user: The server has either erred or is incapable of performing the requested operation. __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:1029
2017-12-21 01:14:12.112 23740 INFO nova.api.openstack.placement.requestlog [req-9975de8b-6784-4555-981c-fb57314535bc admin admin] 10.8.4.18 "DELETE /placement/resource_providers/7d2590ae-fb85-4080-9306-058b4c915e31" status: 500 len: 128 microversion: 1.15
[pid: 23740|app: 0|req: 248/496] 10.8.4.18 () {74 vars in 1688 bytes} [Thu Dec 21 01:14:11 2017] DELETE /placement/resource_providers/7d2590ae-fb85-4080-9306-058b4c915e31 => generated 128 bytes in 220 msecs (HTTP/1.1 500) 4 headers in 191 bytes (1 switches on core 0)
** Affects: nova
Importance: Undecided
Assignee: Yikun Jiang (yikunkero)
Status: In Progress
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1739571
Title:
Can't delete root resource provider because of the self foreign key
Status in OpenStack Compute (nova):
In Progress
Bug description:
Description
===========
Current, we can't delete the root resource provider record
because it has a foreign key reference it id on itself, we will
get back DBReferenceError, the reason is "Cannot delete or
update a parent row: a foreign key constraint fails".
NOTE: it is a essential case(just create and delete), but it doesn't
be triggered in test case because SQLLite allow us to delete it, but
we found this error in MYSQL database.
Steps to reproduce
==================
1. First create a resource provider without parent uuid.
curl -X POST http://10.76.6.31/placement/resource_providers -H "X-Auth-Token: $TOKEN" -H "OpenStack-API-Version: placement 1.15" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"name": "rp1", "uuid": "7d2590ae-9999-4080-9306-058b4c915e32"}'
We fill the id as it default the root_provider_uuid, code as below:
https://github.com/openstack/nova/blob/76dfdfc1ad8c0e5376bd997e45f65bec9ff53d12/nova/objects/resource_provider.py#L802-L809
2. Ensure it has been created.
curl -X GET http://10.76.6.31/placement/resource_providers/7d2590ae-9999-4080-9306-058b4c915e32 -H "X-Auth-Token: $TOKEN" -H "OpenStack-API-Version: placement 1.15" -H "Accept: application/json"
3. Try delete it
curl -X DELETE http://10.76.6.31/placement/resource_providers/7d2590ae-9999-4080-9306-058b4c915e32 -H "X-Auth-Token: $TOKEN" -H "OpenStack-API-Version: placement 1.15" -H "Accept: application/json"
yea, we can't delete it, and get back 500 ERROR: {"computeFault":
{"message": "The server has either erred or is incapable of performing
the requested operation.", "code": 500}}
Logs & Traceback
==============
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack [req-9975de8b-6784-4555-981c-fb57314535bc admin admin] Caught error: (pymysql.err.IntegrityError) (1451, u'Cannot delete or update a parent row: a foreign key constraint fails (`nova_api`.`resource_providers`, CONSTRAINT `resource_providers_ibfk_1` FOREIGN KEY (`root_provider_id`) REFERENCES `resource_providers` (`id`))') [SQL: u'DELETE FROM resource_providers WHERE resource_providers.id = %(id_1)s'] [parameters: {u'id_1': 3}]: DBReferenceError: (pymysql.err.IntegrityError) (1451, u'Cannot delete or update a parent row: a foreign key constraint fails (`nova_api`.`resource_providers`, CONSTRAINT `resource_providers_ibfk_1` FOREIGN KEY (`root_provider_id`) REFERENCES `resource_providers` (`id`))') [SQL: u'DELETE FROM resource_providers WHERE resource_providers.id = %(id_1)s'] [parameters: {u'id_1': 3}]
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack Traceback (most recent call last):
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/api/openstack/__init__.py", line 82, in __call__
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return req.get_response(self.application)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1327, in send
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack application, catch_exc_info=False)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1291, in call_application
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack app_iter = application(self.environ, start_response)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 131, in __call__
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 196, in call_func
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return self.func(req, *args, **kwargs)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/api/openstack/placement/microversion.py", line 117, in __call__
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack response = req.get_response(self.application)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1327, in send
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack application, catch_exc_info=False)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1291, in call_application
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack app_iter = application(self.environ, start_response)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/api/openstack/placement/handler.py", line 220, in __call__
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return dispatch(environ, start_response, self._map)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/api/openstack/placement/handler.py", line 147, in dispatch
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return handler(environ, start_response)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 131, in __call__
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/api/openstack/placement/wsgi_wrapper.py", line 29, in call_func
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack super(PlacementWsgify, self).call_func(req, *args, **kwargs)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 196, in call_func
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return self.func(req, *args, **kwargs)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/api/openstack/placement/handlers/resource_provider.py", line 208, in delete_resource_provider
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack resource_provider.destroy()
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/objects/resource_provider.py", line 688, in destroy
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack self._delete(self._context, self.id)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py", line 984, in wrapper
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return fn(*args, **kwargs)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/opt/stack/nova/nova/objects/resource_provider.py", line 845, in _delete
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack delete(synchronize_session=False)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 3212, in delete
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack delete_op.exec_()
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 1179, in exec_
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack self._do_exec()
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 1363, in _do_exec
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack mapper=self.mapper)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1154, in execute
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack bind, close_with_result=True).execute(clause, params or {})
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 945, in execute
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return meth(self, multiparams, params)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack return connection._execute_clauseelement(self, multiparams, params)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack compiled_sql, distilled_params
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack context)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1398, in _handle_dbapi_exception
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack util.raise_from_cause(newraise, exc_info)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack reraise(type(exception), exception, tb=exc_tb, cause=cause)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack context)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 470, in do_execute
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack cursor.execute(statement, parameters)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/cursors.py", line 166, in execute
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack result = self._query(query)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/cursors.py", line 322, in _query
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack conn.query(q)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 856, in query
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack self._affected_rows = self._read_query_result(unbuffered=unbuffered)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 1057, in _read_query_result
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack result.read()
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 1340, in read
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack first_packet = self.connection._read_packet()
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 1014, in _read_packet
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack packet.check_error()
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 393, in check_error
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack err.raise_mysql_exception(self._data)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/pymysql/err.py", line 107, in raise_mysql_exception
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack raise errorclass(errno, errval)
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack DBReferenceError: (pymysql.err.IntegrityError) (1451, u'Cannot delete or update a parent row: a foreign key constraint fails (`nova_api`.`resource_providers`, CONSTRAINT `resource_providers_ibfk_1` FOREIGN KEY (`root_provider_id`) REFERENCES `resource_providers` (`id`))') [SQL: u'DELETE FROM resource_providers WHERE resource_providers.id = %(id_1)s'] [parameters: {u'id_1': 3}]
2017-12-21 01:14:12.019 23740 ERROR nova.api.openstack
2017-12-21 01:14:12.030 23740 INFO nova.api.openstack [req-9975de8b-6784-4555-981c-fb57314535bc admin admin] http://10.76.6.31/placement/resource_providers/7d2590ae-fb85-4080-9306-058b4c915e31 returned with HTTP 500
2017-12-21 01:14:12.110 23740 DEBUG nova.api.openstack.wsgi [req-9975de8b-6784-4555-981c-fb57314535bc admin admin] Returning 500 to user: The server has either erred or is incapable of performing the requested operation. __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:1029
2017-12-21 01:14:12.112 23740 INFO nova.api.openstack.placement.requestlog [req-9975de8b-6784-4555-981c-fb57314535bc admin admin] 10.8.4.18 "DELETE /placement/resource_providers/7d2590ae-fb85-4080-9306-058b4c915e31" status: 500 len: 128 microversion: 1.15
[pid: 23740|app: 0|req: 248/496] 10.8.4.18 () {74 vars in 1688 bytes} [Thu Dec 21 01:14:11 2017] DELETE /placement/resource_providers/7d2590ae-fb85-4080-9306-058b4c915e31 => generated 128 bytes in 220 msecs (HTTP/1.1 500) 4 headers in 191 bytes (1 switches on core 0)
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1739571/+subscriptions
Follow ups