Discovery queue is not draining - error in discovery logs mentions duplicate key in CM_NIMBUS_PACKAGE

Document ID : KB000006728
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

In the discovery_server log we see something similar to the following


15 Dec 2015 15:20:33,965 [robotWorker-1] ERROR com.nimsoft.discovery.common.util.ExceptionUtil - PackagePersister exception for /PrimaryHub/nimSecondaryHub/robot01 : org.springframework.dao.DuplicateKeyException: PreparedStatementCallback; SQL []; Violation of PRIMARY KEY constraint 'PK_CM_NIMBUS_PACKAGE'. Cannot insert duplicate key in object 'dbo.CM_NIMBUS_PACKAGE'. The duplicate key value is (1182, cdm-pagefile).; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK_CM_NIMBUS_PACKAGE'. Cannot insert duplicate key in object 'dbo.CM_NIMBUS_PACKAGE'. The duplicate key value is (1182, ccdm_pagefile).

Environment:
Unified Infrastructure Manager 8.2
Cause:

This is due to multiple packages with the same name being installed on the same robot. It causes an issue in the 8.2 discovery server that causes discovery_server to hang due to a unique key constraint.

Resolution:
  1. Stop discovery_server
  2. In Infrastructure Manager, navigate to the robot that is listed in the error message
    • For example, /PrimaryHub/nimSecondaryHub/robot01in the error message above.
  3. Select the 'controller' probe on this hub itself and press CTRL+P for probe utility
  4. Run the probe callback "inst_list_summary"
  5. You should see the package that is causing issues
    • In this example cdm-pagefile
  6. In the probe utility run inst_list_remove and insert the name of the package.
    • In this example cdm-pagefile
  7. Clear the niscache on the same hub/robot
  8. Reactivate the discovery_server
    • You may need to clear out the discovery_server queue to help it catch up.
  9. Retest - issue should resolved