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

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

book

Article ID: 6728

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM) CA Unified Infrastructure Management On-Premise (Nimsoft / UIM) CA Unified Infrastructure Management SaaS (Nimsoft / UIM)

Issue/Introduction

In the discovery_server log we see something similar to the following

[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, cdm-pagefile).

Environment

  • DX UIM 20.4 or higher

Cause

  • This is due to multiple packages with the same name being installed on the same robot - usually with upper and lower case, e.g. CDM-pagefile and cdm-pagefile.

  • This can be seen in the 'installed.pkg' file located at ($NIMSOFT_HOME)/robot/pkg/inst/installed.pkg 

Resolution

  1. Deactivate 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 the 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. Activate the discovery_server

    • You may need to clear out the discovery_server queue to help it catch up.

  9. Retest - and issue should be resolved.