← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1296690] [NEW] nova-manage db arvhice_deleted_rows doesn't work

 

Public bug reported:

nova-manage db archive_delete_rows command cannot delete instance table.
instance_actions tables is related on instance table.
but instance_actions is not deleted even if instance is deleted.

$ nova-manage db archive_deleted_rows --max_rows 100
2014-03-24 12:05:55.855 ERROR nova.db.sqlalchemy.api [req-c342c3d2-2f3c-4612-b03b-946a5d4323ff None None] IntegrityError detected when archiving table instances
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api Traceback (most recent call last):
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 5613, in archive_deleted_rows_for_table
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     result_delete = conn.execute(delete_statement)
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 662, in execute
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     params)
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 761, in _execute_clauseelement
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     compiled_sql, distilled_params
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 874, in _execute_context
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     context)
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1024, in _handle_dbapi_exception
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     exc_info
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 196, in raise_from_cause
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     reraise(type(exception), exception, tb=exc_tb)
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 867, in _execute_context
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     context)
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 324, in do_execute
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     cursor.execute(statement, parameters)
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 205, in execute
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     self.errorhandler(self, exc, value)
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     raise errorclass, errorvalue
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api IntegrityError: (IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`nova`.`instance_actions`, CONSTRAINT `fk_instance_actions_instance_uuid` FOREIGN KEY (`instance_uuid`) REFERENCES `instances` (`uuid`))') 'DELETE FROM instances WHERE instances.id in (SELECT T1.id FROM (SELECT instances.id \nFROM instances \nWHERE instances.deleted != %s ORDER BY instances.id \n LIMIT %s) as T1)' (0, 100)
2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api

** Affects: nova
     Importance: Undecided
         Status: New

-- 
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/1296690

Title:
  nova-manage db arvhice_deleted_rows doesn't work

Status in OpenStack Compute (Nova):
  New

Bug description:
  nova-manage db archive_delete_rows command cannot delete instance table.
  instance_actions tables is related on instance table.
  but instance_actions is not deleted even if instance is deleted.

  $ nova-manage db archive_deleted_rows --max_rows 100
  2014-03-24 12:05:55.855 ERROR nova.db.sqlalchemy.api [req-c342c3d2-2f3c-4612-b03b-946a5d4323ff None None] IntegrityError detected when archiving table instances
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api Traceback (most recent call last):
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 5613, in archive_deleted_rows_for_table
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     result_delete = conn.execute(delete_statement)
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 662, in execute
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     params)
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 761, in _execute_clauseelement
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     compiled_sql, distilled_params
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 874, in _execute_context
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     context)
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1024, in _handle_dbapi_exception
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     exc_info
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 196, in raise_from_cause
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     reraise(type(exception), exception, tb=exc_tb)
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 867, in _execute_context
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     context)
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 324, in do_execute
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     cursor.execute(statement, parameters)
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 205, in execute
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     self.errorhandler(self, exc, value)
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api   File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api     raise errorclass, errorvalue
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api IntegrityError: (IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`nova`.`instance_actions`, CONSTRAINT `fk_instance_actions_instance_uuid` FOREIGN KEY (`instance_uuid`) REFERENCES `instances` (`uuid`))') 'DELETE FROM instances WHERE instances.id in (SELECT T1.id FROM (SELECT instances.id \nFROM instances \nWHERE instances.deleted != %s ORDER BY instances.id \n LIMIT %s) as T1)' (0, 100)
  2014-03-24 12:05:55.855 TRACE nova.db.sqlalchemy.api

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


Follow ups

References