CAPC Global Sync Error

Document ID : KB000117908
Last Modified Date : 20/10/2018
Show Technical Document Details
Issue:
the global synch is failing and when we checked the DMService.log we see an error;
 

ERROR | pool-4-thread-1 | 2018-10-25 18:58:53,343 | com.ca.im.portal.dm.productsync.DataSourcePoller 

| Exception thrown by sync task: org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [UPDATE items i INNER JOIN item_members im ON i.ItemID=im.ParentID AND i.ItemType=6 INNER JOIN t_interface o ON i.ItemID=o.ItemID INNER JOIN t_address t ON im.ChildID=t.ItemID SET t.OwnerItemID=i.ItemID, t.OwnerAlternateName=o.AlternateName, t.OwnerItemName=o.ItemName, t.OwnerLifeCycleState=o.LifeCycleState, t.OwnerLifeCycleStateLastChangedOn=o.LifeCycleStateLastChangedOn WHERE (im.UpdatedOn>=1506220653 OR i.UpdatedOn>=1506220653 OR t.OwnerItemID IS NULL)]; Column 'OwnerItemName' cannot be null; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'OwnerItemName' cannot be null

 

Environment:
CAPC 3.6
Cause:

 Per the vendor certification, to assign a component a name this formula is used: 

 

((isdef(ifName)&&ifName!=empty)?ifName:((isdef(ifDescr)&&ifDescr!=empty)?ifDescr:"Interface " + ifIndex)) + " - " + (ifAlias)

 

 So for the name to be null, ifName, ifDescr and ifAlias needs to not be present.

Resolution:
use mysql queries to check if there are interfaces with no names, and then find those parents and remove them, or populate the missing info in the device mibs:
 

mysql netqosportal -unetqos -pnetqos

first check for interfaces:
select sourceid,localid,itemname,itemid, ifdescr, ifname, ifalias, ifIndex from dst_interface where itemname is null;

then find the parent devices:
select itemname from t_device where itemid in (select owneritemid from t_interface where itemid in (select itemid from dst_interface where itemname is null));

and either remove them or fix the missing information