← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1596933] [NEW] IntegrityError while archiving if consoles are not deleted

 

Public bug reported:

On deleting the instance its associated console entries will not be
deleted which will cause "IntegrityError" while archiving the deleted
records from database.

1. Create an instance.

$ nova boot test-1 --flavor 1 --image cirros-0.3.4-x86_64-uec

2. Create an entry in console table manually with the above created
instance_uuid.

insert into consoles (created_at, updated_at, instance_name, password,
port, instance_uuid, deleted) values ('2016-06-15 06:00:13', '2016-06-15
06:00:13', 'test-1', '12345', 8080, '326757a3-66da-455f-8ffa-
29775de1d5f5', 0);


3. Delete 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}]

Note:
I have added db entry manually as console service is not enabled in my environment.

** Affects: nova
     Importance: Undecided
     Assignee: Bhagyashri Shewale (bhagyashri-shewale)
         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/1596933

Title:
  IntegrityError while archiving if consoles are not deleted

Status in OpenStack Compute (nova):
  New

Bug description:
  On deleting the instance its associated console entries will not be
  deleted which will cause "IntegrityError" while archiving the deleted
  records from database.

  1. Create an instance.

  $ nova boot test-1 --flavor 1 --image cirros-0.3.4-x86_64-uec

  2. Create an entry in console table manually with the above created
  instance_uuid.

  insert into consoles (created_at, updated_at, instance_name, password,
  port, instance_uuid, deleted) values ('2016-06-15 06:00:13',
  '2016-06-15 06:00:13', 'test-1', '12345', 8080, '326757a3-66da-455f-
  8ffa-29775de1d5f5', 0);

  
  3. Delete 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}]

  Note:
  I have added db entry manually as console service is not enabled in my environment.

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


Follow ups