Getting Error with Master UDB file in Universe Failed to add a resource (YourResourceName) to resource array; Error: -2
search cancel

Getting Error with Master UDB file in Universe Failed to add a resource (YourResourceName) to resource array; Error: -2

book

Article ID: 112305

calendar_today

Updated On:

Products

CA Identity Manager CA Identity Governance CA Identity Portal

Issue/Introduction

We are running our 3rd quarter campaign , for one of the application in universe when we are trying to import through the custom executable connector we are getting the successful result but the master config file didn't get merge with the new config generated.
We see the below error while opening the master configuration file from universe.

Task Done 1000 Resources added 2000 Resources added 3000 Resources added 4000 Resources added Failed to add a resource (example_resource) to resource array; Error: -2 Resource array contains 4550 resources Task Done Total Time Elapsed: 2168 ms Bulk Insert Time: 0 ms; Bulk Size: 10000 CTaskList::ExecuteTasks ended Failed to open config file: SQL://<IG_DB>@ <IG_PROD_host>./example_Master.cfg

Also same error happen when we try to open the master resource db.

Environment

Release:
Component: SGRM

Resolution

This situation can happen when resources are imported from different connectors using the custom executable connector.

With a customized table, there is no duplicate checking and that can allow for these imports with duplicated data.

Failed to add a resource (example_resource) to resource array; Error: -2 Resource array contains 4550 resources

The means that the data in Resource 4550 has been found already in an earlier record.

As this requires database updates, please confirm a full DB backup has been performed before proceeding. Please open a case with L1 support if needed.

We need to find the databaseID for the Resource: Select * from resources where ResourceID='4550' This will return data with the databaseID column used in later queries.
Second we need to find out if there are more then one resources within that DatabaseID with duplicate entries: Select RESNAME2,RESNAME3,count(*) from resources where DatabaseID = 'FoundInLastQuery' group by trim(RESNAME1),RESNAME2,RESNAME3 HAVING count (*) >1; Thirdly using this query we will uncover the duplicate ResourceID where the data was found that cause the error with the reported ResourceID. Select * from resources where DatabaseID = '11882' and RESNAME2='FoundInLastQuery' and RESNAME3='FoundInLastQuery'

Once we have identified the First record and the second Record, it is up to you on which Record you would want to delete. You could also update the RESNAME1,RESNAME2,RESNAME3 of the duplicate if you wish to keep both. DELETE FROM ResourceFields WHERE DatabaseID = AND ResourceID = ;