Client Automation - Database error AMM001002 while creating a policy.
search cancel

Client Automation - Database error AMM001002 while creating a policy.

book

Article ID: 201998

calendar_today

Updated On:

Products

CA Client Automation - IT Client Manager CA Client Automation

Issue/Introduction

While trying to create any policy, the following error is shown:

Database Error! [AMM001002]

Environment

Client Automation - 14.0 and above

Cause

Reviewing TRC_GUI log, the following can be seen:

|INFO   | msg-id:68, API_FUNCTION_OBJECT_METHOD_MARSHALL(METHOD=SAVE;CLASSID=3301;FLAG=0;FLAG2=0;)
oduuid=00000000000000000000000000000000;ouuid=00000000000000000000000000000000;odid=1348610740;oid=0;otype=10;otitle=prueba6;area=7;event=15;type=1;state=0;refid1=0;refid2=0;refid3=1;refid4=0;refuuid1=58b0236ea7355f488514c939993e61af;refuuid2=00000000000000000000000000000000;refuuid3=00000000000000000000000000000000;refuuid4=00000000000000000000000000000000;history=1;days=30;format=0;supjobs=1,2,3,4,6,8,9,10,11,13,14,16,17,102;

|ERROR  | msg-id:68, return:3011, error: 1002
|INFO   | MessageBox (Single item) - Item: ? (?) Message: "Database Error! [AMM001002]"

If this is found, TRC_AMMGR log must be reviewed during same time frame, which may show the following errors:

|DETAIL | Execute SQL command
|INFO   | CDb_Ado::ExecSQL() enter - UPDATE NCPROFIL SET PROFILLN=PROFILLN+1 WHERE PROFILID=250

|DETAIL | Execute SQL command
|INFO   | CDb_Ado::ExecSQL() enter - INSERT INTO AMEPDEF (policy_uuid,creation_user,creation_date,DOMAINID,EPID) VALUES (0x747764703841d443888b9233ff78edf7,'winnt://elrosado/itsmadmin',1603069830,1348610740,26)
|NOTIFY | evalSQLInfo sqlstate: 01000 native error: 3621 0xe25
|NOTIFY | evalSQLInfo description: The statement has been terminated. source: Microsoft SQL Server Native Client 11.0

|NOTIFY | evalSQLInfo sqlstate: 23000 native error: 2627 0xa43|NOTIFY | evalSQLInfo description: Violation of PRIMARY KEY constraint 'XPKamepdef'. Cannot insert duplicate key in object 'dbo.amepdef'. The duplicate key value is (26, 1348610740). source: Microsoft SQL Server Native Client 11.0

|NOTIFY | Error Message: ADO Version 10.0 - COM Error: ErrorCode:-2147217873,WordErrorCode:3119, IDispatch error #3119, Violation of PRIMARY KEY constraint 'XPKamepdef'. Cannot insert duplicate key in object 'dbo.amepdef'. The duplicate key value is (26, 1348610740)., Microsoft SQL Server Native Client 11.0, (null)

|ERROR  | Save() method on  event policy returned failure

This clearly indicates a data problem on the related tables in the MDB.

Resolution

The following 2 queries must be executed:

SELECT MAX(EPID) 'Max EPID' FROM AMEPDEF WHERE domainid=(SELECT domain_id FROM ca_n_tier WHERE domain_uuid=(SELECT set_val_uuid FROM ca_settings WHERE set_id=1))

SELECT profilln FROM ncprofil WHERE profilid=250

The result of them must be the same, if there is any difference, then a problem has been found.

If the result of the second query is lower than the result of the first, then the following UPDATE must be executed:

UPDATE NCPROFIL
SET PROFILLN=(SELECT MAX(EPID) FROM AMEPDEF where domainid=(select domain_id from ca_n_tier where domain_uuid=(select set_val_uuid from ca_settings where set_id=1)))
WHERE PROFILID=250

 

NOTE: Take a full backup of the MDB before doing any manual modification.