Comment 1 for bug 1596933

Revision history for this message
Abhishek Kekane (abhishek-kekane) wrote :

Steps to reproduce:

1. Create an instance.
$ nova boot test-1 --flavor 1 --image cirros-0.3.4-x86_64-uec

2. Create a console using api: /servers/{server_id}/consoles

3. Delete an instance
$ nova delete 326757a3-66da-455f-8ffa-29775de1d5f5

4. Call db archive which raises following error
$ nova-manage db archive_deleted_rows 1000

2016-06-15 14:23:27.837 WARNING nova.db.sqlalchemy.api [-] IntegrityError detected when archiving table instances: (pymysql.err.IntegrityError) (1451, u'Cannot delete or update a parent row: a foreign key constraint fails (`nova`.`consoles`, CONSTRAINT `consoles_instance_uuid_fkey` FOREIGN KEY (`instance_uuid`) REFERENCES `instances` (`uuid`))') [SQL: u'DELETE FROM instances WHERE instances.id in (SELECT T1.id FROM (SELECT instances.id \nFROM instances \nWHERE instances.deleted != %(deleted_1)s ORDER BY instances.id \n LIMIT %(param_1)s) as T1)'] [parameters: {u'param_1': 979, u'deleted_1': 0}]