RHEL OSP installer ERROR:ironic_discoverd.node_cache:Database integrity error columns name, value are not unique during adding attributes

Solution Unverified - Updated -

Environment

  • Red Hat Enterprise Linux OpenStack Platform (RHEL OSP) Version 7.0 - 7.2

Issue

  • An error during OpenStack installation may require nodes to be deleted and a re-start of introspection.
  • In this scenario introspection started on one node, before introspection finished the user deleted the node using
    openstack baremetal delete <nodeUUID>
  • Restarting introspection on the node causes the error below.
Jan  6 18:12:19 localhost ironic-discoverd: ERROR:ironic_discoverd.node_cache:Database integrity error columns name, value are not unique during adding attributes
Jan  6 18:12:19 localhost ironic-discoverd: ERROR:ironic_discoverd.utils:Some or all of mac's [u'52:54:00:3a:21:3c'] are already on introspection

Resolution

In order to recover from this error delete all nodes. Ensure the output of the below command is empty.

$ ironic node-list

If nodes are still in the list, then delete them with

$ ironic node-delete <nodeUUID>

To clear the discovery db do the following:

$ sudo rm -f /var/lib/ironic-discoverd/discoverd.sqlite
$ sudo systemctl restart openstack-ironic-discoverd

Root Cause

  • The ironic database becomes corrupted when the ironic node-delete command is run while node introspection is in progress.
  • User is recommended to check the status of the node introspection before deleting the node.
$ openstack baremetal introspection status <nodeUUID>

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments