"nova-manage db archive_deleted_rows" command fails with IntegrityError, Duplicate entry for key 'PRIMARY'

Solution Verified - Updated -

Issue

  • nova-manage db archive_deleted_rows command fails because of DBDuplicateEntry oslo.db error (pymysql.err.IntegrityError)
  • When running a nova-manage db archive_deleted_rows command, it fails to add an entry to shadow_reservations table and generated an error starting with following text:

    DBDuplicateEntry: (pymysql.err.IntegrityError) (1062, u"Duplicate entry '3' for key 'PRIMARY'") [SQL: u'INSERT INTO shadow_reservations (created_at, updated_at, deleted_at, deleted, id, uuid, usage_id, project_id, user_id, resource, delta, expire) SELECT reservations.created_at, reservations.updated_at, reservations.deleted_at, reservations.deleted, reservations.id, reservations.uuid, reservations.usage_id, reservations.project_id, reservations.user_id, reservations.resource, reservations.delta, reservations.expire \nFROM reservations \nWHERE reservations.id IN
    

Environment

  • Red Hat Openstack Platform 13.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content