Exceptions in discovery_server logs related to deleted discovery_agent
search cancel

Exceptions in discovery_server logs related to deleted discovery_agent

book

Article ID: 145699

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

Exceptions in discovery_server logs which keep repeating at regular intervals

3 Jan 2020 09:14:20,475 [probeTask-4] ERROR com.nimsoft.discovery.common.util.ExceptionUtil - Error during NIS graph import:org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL []; The UPDATE statement conflicted with the FOREIGN KEY constraint "FK_CM_COMPUTER_SYSTEM_CM_DISCOVERY_AGENT". The conflict occurred in database "CA_UIM", table "dbo.CM_DISCOVERY_AGENT", column 'da_id'.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: The UPDATE statement conflicted with the FOREIGN KEY constraint "FK_CM_COMPUTER_SYSTEM_CM_DISCOVERY_AGENT". The conflict occurred in database "CA_UIM", table "dbo.CM_DISCOVERY_AGENT", column 'da_id'.

Environment

Release : 9.2.0

Component : UIM - DISCOVERY_SERVER

Resolution



The cm_discovery_agent table shows single entry for discovery_agent 



The cm_device_attribute table still references a additional da_id for a discovery_agent which might have been deleted earlier 



From above output it is evident that discovery_agent with da_id = 1 is been removed from CM_DISCOVERY_AGENT table and still referred to in CM_DEVICE_ATTRIBUTE.

Steps to Resolve

1)Take  backup of the table CM_DEVICE_ATTRIBUTE table or full database backup 

2)Delete the orphan entry 

DELETE FROM CM_DEVICE_ATTRIBUTE WHERE dev_attr_key = ‘da_id’ AND dev_attr_value = 1;

3)Deactivate and activate discovery_server probe 

4)Verify in discovery_server logs that this exception does not recur


Additional Information

How to delete discovery_agents and eliminate them from being displayed in USM

https://ca-broadcom.wolkenservicedesk.com/external/article?articleId=33922


After removing a hub from the environment I am still seeing the discovery Server trying to contact the now missing discovery Agent and presenting and error in the discovery_server.log. How do I correct it?

https://ca-broadcom.wolkenservicedesk.com/external/article?articleId=6093