While trying to create any policy, the following error is shown:
Database Error! [AMM001002]
Client Automation - 14.0 and above
Reviewing TRC_GUI log, the following can be seen:
|INFO | msg-id:68, API_FUNCTION_OBJECT_METHOD_
oduuid=
|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,
|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,
|ERROR | Save() method on event policy returned failure
This clearly indicates a data problem on the related tables in the MDB.
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.