DR - Error [ERROR] Slave SQL: Error 'Duplicate entry 'XXXX' for key 'PRIMARY'' on query. in padr.log
109
Created On 11/10/26 10:55 AM - Last Modified 11/10/26 12:56 PM
Symptom
The following error appears in PADR.log:
[ERROR] Slave SQL: Error 'Duplicate entry '338482' for key 'PRIMARY'' on query. Default database: 'ca_vault'. Query: '/*CAINFO:DR_Fallback|DR_Failback|BackupFilesListServ|*/INSERT INTO vault_safes_log VALUES (71,1522012382,1529788382,0,194,'U=DR_Failback/S=Notification Engine',
Usually this is seen for the vault_safes_log and vault_user_log tables.
Environment
9.3;9.5;9.6;9.7;9.8;9.9;9.9.5;9.10;10.0;10.1;10.2;10.3;10.4;10.5;10.10;11.1;11;11.2;11.3;11.4;11.5;11.6 DR vault
Cause
When both vaults are up (on Prod and DR sites), both write audits to vault_safes_log and vault_user_log.
On site1 there is data X in this entry number and on site2 there is data Y in this entry number.
When starting DR replication, the data X from PROD is replicated to DR, but DR says there is already another record at this place and throws an error.
Resolution
A full replication should be generated automatically in this instance, which usually self-resolves the error.
If not, generate a Full replication.
HOW TO AVOID:
Perform a full replication when failing the DR vault back to DR mode. Directions for this can be found in the following article:
https://community.cyberark.com/s/article/DR-replication-not-completed-successfully
Additional Information
Details
PROBLEM:
error in Padr.log
2018-03-25 23:12:30 3696 [ERROR] Slave SQL: Error 'Duplicate entry '338482' for key 'PRIMARY'' on query. Default database: 'ca_vault'. Query: '/*CAINFO:DR_Fallback|DR_Failback|BackupFilesListServ|*/INSERT INTO vault_safes_log VALUES (71,1522012382,1529788382,0,194,'U=DR_Failback/S=Notification Engine',
Usually seen for vault_safes_log and vault_user_log tables.
REASON:
When both vaults are up (on Prod and DR sites), both write audits to vault_safes_log and vault_user_log.
So on site1 there is data X in this entry number and on site2 there is data Y in this entry number.
When starting DR replication, the data X from PROD replicated to DR, but DR says there is already another record at this place and throw the error.
SOLUTION:
The automatic Full replication is generated as recovery should solve it.
The automatic Full replication is generated as recovery should solve it.
If not, generate a Full replication.
HOW TO AVOID:
We require to perform the Full replication when the Vault was up on the DR server, before returning it back to DR mode.