cannot delete a deployment once a task runned

Bug #1568344 reported by amir gohar on 2016-04-09
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Rally
Undecided
Rodion Promyshlennikov

Bug Description

Rally 0.3.3

Steps t reproduce:

1- Add a deployment
2- run a task
3- delete a deployment

this only happens in mysql...it works fine with sqllitedb

it will fail with following trace:

webv2_1 | api.Deployment.destroy(uuid)
webv2_1 | File "/usr/local/lib/python2.7/site-packages/rally/api.py", line 93, in destroy
webv2_1 | deployment.delete()
webv2_1 | File "/usr/local/lib/python2.7/site-packages/rally/common/objects/deploy.py", line 94, in delete
webv2_1 | db.deployment_delete(self.deployment["uuid"])
webv2_1 | File "/usr/local/lib/python2.7/site-packages/rally/common/db/api.py", line 234, in deployment_delete
webv2_1 | return get_impl().deployment_delete(uuid)
webv2_1 | File "/usr/local/lib/python2.7/site-packages/rally/common/db/sqlalchemy/api.py", line 310, in deployment_delete
webv2_1 | filter_by(uuid=uuid).delete(synchronize_session=False))
webv2_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 3048, in delete
webv2_1 | delete_op.exec_()
webv2_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 1127, in exec_
webv2_1 | self._do_exec()
webv2_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 1311, in _do_exec
webv2_1 | mapper=self.mapper)
webv2_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 1034, in execute
webv2_1 | bind, close_with_result=True).execute(clause, params or {})
webv2_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
webv2_1 | return meth(self, multiparams, params)
webv2_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
webv2_1 | return connection._execute_clauseelement(self, multiparams, params)
webv2_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
webv2_1 | compiled_sql, distilled_params
webv2_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
webv2_1 | context)
webv2_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1337, in _handle_dbapi_exception
webv2_1 | util.raise_from_cause(newraise, exc_info)
webv2_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
webv2_1 | reraise(type(exception), exception, tb=exc_tb, cause=cause)
webv2_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
webv2_1 | context)
webv2_1 | File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
webv2_1 | cursor.execute(statement, parameters)
webv2_1 | File "/usr/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
webv2_1 | self.errorhandler(self, exc, value)
webv2_1 | File "/usr/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
webv2_1 | raise errorclass, errorvalue
webv2_1 | DBReferenceError: (_mysql_exceptions.IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`rally`.`tasks`, CONSTRAINT `tasks_ibfk_1` FOREIGN KEY (`deployment_uuid`) REFERENCES `deployments` (`uuid`))') [SQL: u'DELETE FROM deployments WHERE deployments.uuid = %s'] [parameters: ('e41071a8-5d75-4709-ad0a-f1ca00cf9026',)]

amir gohar (c-amir) on 2016-04-11
tags: added: delete deployment mysql
description: updated
Boris Pavlovic (boris-42) wrote :

did you run command "rally-manage db upgrade"

amir gohar (c-amir) wrote :

yeah it didn't help

Changed in rally:
assignee: nobody → Rodion Promyshlennikov (rpromyshlennikov)
Changed in rally:
status: New → Confirmed
Changed in rally:
status: Confirmed → In Progress

Change abandoned by Boris Pavlovic (<email address hidden>) on branch: master
Review: https://review.openstack.org/304301
Reason: we are going to remove deployment children

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers