After upgrade to UIM 9.0.2 the discovery_server doesn't start, showing the following error in discovery_server.log:
22 May 2020 10:33:52,186 [main] INFO com.nimsoft.nimbus.PFProbe - ****************[ Stopped ]**************** 22 May 2020 10:33:52,186 [main] FATAL com.nimsoft.discovery.server.probe.DiscoveryServerProbe - Probe exception: (1) error, Failed to initialize probe lifecycle: (1) error, org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [DELETE FROM CM_NIMBUS_ROBOT WHERE robot_id=?]; The DELETE statement conflicted with the REFERENCE constraint "FK_CM_NIMBUS_ROBOT_PROBE". The conflict occurred in database "CA_UIM", table "dbo.CM_NIMBUS_PROBE", column 'robot_id'.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: The DELETE statement conflicted with the REFERENCE constraint "FK_CM_NIMBUS_ROBOT_PROBE". The conflict occurred in database "CA_UIM", table "dbo.CM_NIMBUS_PROBE", column 'robot_id'.: PreparedStatementCallback; SQL [DELETE FROM CM_NIMBUS_ROBOT WHERE robot_id=?]; The DELETE statement conflicted with the REFERENCE constraint "FK_CM_NIMBUS_ROBOT_PROBE". The conflict occurred in database "CA_UIM", table "dbo.CM_NIMBUS_PROBE", column 'robot_id'.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: The DELETE statement conflicted with the REFERENCE constraint "FK_CM_NIMBUS_ROBOT_PROBE". The conflict occurred in database "CA_UIM", table "dbo.CM_NIMBUS_PROBE", column 'robot_id'. 22 May 2020 10:33:52,186 [main] FATAL com.nimsoft.discovery.server.probe.DiscoveryServerProbe - (1) error, Failed to initialize probe lifecycle: (1) error, org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [DELETE FROM CM_NIMBUS_ROBOT WHERE robot_id=?]; The DELETE statement conflicted with the REFERENCE constraint "FK_CM_NIMBUS_ROBOT_PROBE". The conflict occurred in database "CA_UIM", table "dbo.CM_NIMBUS_PROBE", column 'robot_id'.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: The DELETE statement conflicted with the REFERENCE constraint "FK_CM_NIMBUS_ROBOT_PROBE". The conflict occurred in database "CA_UIM", table "dbo.CM_NIMBUS_PROBE", column 'robot_id'.: PreparedStatementCallback; SQL [DELETE FROM CM_NIMBUS_ROBOT WHERE robot_id=?]; The DELETE statement conflicted with the REFERENCE constraint "FK_CM_NIMBUS_ROBOT_PROBE". The conflict occurred in database "CA_UIM", table "dbo.CM_NIMBUS_PROBE", column 'robot_id'.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: The DELETE statement conflicted with the REFERENCE constraint "FK_CM_NIMBUS_ROBOT_PROBE". The conflict occurred in database "CA_UIM", table "dbo.CM_NIMBUS_PROBE", column 'robot_id'.
Environment
Release : 9.0.2
Component : ACTIVE DIRECTORY & EXCHANGE SERVER AIM
Cause
Apparently during startup, the probe is doing a deletion on CM_NIMBUS_ROBOT which is conflicting with the CM_NIMBUS_PROBE table. Basically the robot_id column on the row it is be attempted to be deleted in CM_NIMBUS_ROBOT table, it has a reference in CM_NIMBUS_PROBE table Sadly from logs is not clear the robot_id value is being deleted.
Resolution
1. Get a backup from the database in case is required to roll back the changes we will do 2. Make sure the discovery_server and all discovery_agent probes are deactivated, and run next queries on the DB
2.1 delete from CM_NIMBUS_PROBE 2.2 delete from CM_NIMBUS_ROBOT
3. Activate the probe. The discovery_server probe should start ok this time
4. Both tables (CM_NIMBUS_PROBE and CM_NIMBUS_ROBOT) should be populated again.
5. start the discovery_agent probes to finish the procedure.