HDS Error : 80040e2f primary key violation

7 Posts
4 Users
0 Likes
54 Views
f.fleche
(@f-flechearcinfo-com)
Posts: 79
Member Admin
Topic starter
 

One customer uses an association of historical servers with HDS connected to a local database for each server.
V8.2 SP1 0914

HDS logs shows many errors of primary key violation (see below and attached files).

Additionnaly they launch a replication every 10s.

Have you had this kind of issue?

"2012/12/18,18:04:34.972,UPJ4180KSR001,UPJ,HDS,E,0,0,CSchTable::UpdateBatch __ Call TreatComError ID = 'RED_G7R' iTest = 2
2012/12/18,18:04:34.988,UPJ4180KSR001,UPJ,HDS,E,0,0,TreatComError __ ComError Source : 'Microsoft OLE DB Provider for SQL Server' Description : 'Violation de la contrainte PRIMARY KEY 'IX_TREND_RED_G7R_PRIMARY'. Impossible d'insérer une clé en double dans l'objet 'dbo.RED_G7R'.' (80040E2F)
2012/12/18,18:04:35.003,UPJ4180KSR001,UPJ,HDS,E,0,0,TreatComError __ ProviderError '80040e2f' : Description : 'Violation de la contrainte PRIMARY KEY 'IX_TREND_RED_G7R_PRIMARY'. Impossible d'insérer une clé en double dans l'objet 'dbo.RED_G7R'.' SQLState : '23000' NativeError : 2627
2012/12/18,18:04:35.019,UPJ4180KSR001,UPJ,HDS,E,0,0,TreatComError __ ProviderError '80040e2f' : Description : 'L'instruction a été arrêtée.' SQLState : '01000' NativeError : 3621
2012/12/18,18:04:35.034,UPJ4180KSR001,UPJ,HDS,E,0,0,CSchTable::TraceInvalidRecords __ Unexpected Error ID = 'Error writing information. status : 4097 record : '20;130001270110720000;8;RED.G7R.OVERLOAD_REAL;5;111.2;2;192''
2012/12/18,18:04:35.050,UPJ4180KSR001,UPJ,HDS,E,0,0,CSchTable::TraceInvalidRecords __ Unexpected Error ID = 'Error writing information. status : 4097 record : '20;130002852581560000;8;RED.G7R.DCSP.SETPOINT_VALUE;5;0;2;192''
2012/12/18,18:04:35.066,UPJ4180KSR001,UPJ,HDS,E,0,0,CSchTable::TraceInvalidRecords __ Unexpected Error ID = 'Error writing information. status : 4097 record : '20;130002694221530000;8;RED.G7R.DCCURRENT;5;0;2;192''
2012/12/18,18:04:35.066,UPJ4180KSR001,UPJ,HDS,E,0,0,CSchTable::TraceInvalidRecords __ Unexpected Error ID = 'Error writing information. status : 4097 record : '20;130002464871320000;8;RED.G7R.RECT.A.DCCURRENT;5;0;2;192''
2012/12/18,18:04:35.081,UPJ4180KSR001,UPJ,HDS,E,0,0,CSchTable::TraceInvalidRecords __ Unexpected Error ID = 'Error writing information. status : 4097 record : '20;130001270110720000;8;RED.G7R.RECT.VOLT_DROP;5;100;2;192''
2012/12/18,18:04:35.097,UPJ4180KSR001,UPJ,HDS,E,0,0,CSchTable::TraceInvalidRecords __ Unexpected Error ID = 'Error writing information. status : 4097 record : '20;130001270110720000;8;RED.G7R.RECT.B.DCCURRENT;5;0;2;192''
2012/12/18,18:04:35.113,UPJ4180KSR001,UPJ,HDS,E,0,0,CSchTable::TraceInvalidRecords __ Unexpected Error ID = 'Error writing information. status : 4097 record : '20;130003320708790000;8;RED.G7R.TRF.OLTC.OLTC_POSITION;5;1;2;192''
"

 
Posted : 10/01/2013 2:30 am
n.kunzer
(@n-kunzerarcinfo-com)
Posts: 1236
Member Moderator
 

I noticed also this message on PcVue startup (sometimes).
Is it your case?

I think the issue is coming from the exit of PcVue. HDS is supposed to flush its buffer but, for an unknown reason, it keeps those data (already recorded) in a file.
Then, on startup , HDS finds this file and tries to record again the same data => Primary Key violation.

As your customer is using an old version I suggest you check with Arnaud if this anomaly has been already fixed.

 
Posted : 10/01/2013 7:40 am
f.martin
(@f-martinarcinfo-com)
Posts: 148
Member Admin
 

There are 2 kinds of problems that could occurs

First, which kind of timestamping are using ? PLC or SV ?
If it's PLC one, then at startup this kind message appears if variables has not changed between stop and start. Same thing for a comm failure.

Second, in the case of replication, the same thing could happen if some datas has already been recorded in one server and not yet in the other one. Then when the second server try to record the datas, the replication has already done the job. As both servers have the timestamp for a value, its origin (SV or PLC) doesn't matter.

HDS records datas when there is at least a packet of 15 records or every 15s. As replication is faster than HDS, as soon as a server record a data the replication will replicate it in the other server before it does the job by himself.
Try to reduce replication step to 1mn, you should have less error messages.

 
Posted : 10/01/2013 2:46 pm
n.kunzer
(@n-kunzerarcinfo-com)
Posts: 1236
Member Moderator
 

First, which kind of timestamping are using ? PLC or SV ?
If it's PLC one, then at startup this kind message appears if variables has not changed between stop and start. Same thing for a comm failure.

Good Point! I really see anomalies every where ! :whistle:

Second, in the case of replication, the same thing could happen if some datas has already been recorded in one server and not yet in the other one. Then when the second server try to record the datas, the replication has already done the job. As both servers have the timestamp for a value, its origin (SV or PLC) doesn't matter.

HDS records datas when there is at least a packet of 15 records or every 15s. As replication is faster than HDS, as soon as a server record a data the replication will replicate it in the other server before it does the job by himself.
Try to reduce replication step to 1mn, you should have less error messages.

Does it mean that usually, when we use replication, the replication period is less than 1 mn?

 
Posted : 10/01/2013 3:11 pm
f.martin
(@f-martinarcinfo-com)
Posts: 148
Member Admin
 

Additionnaly they launch a replication every 10s.

That's François' customer who do that 😉

Usually replication periods are 1hour, half-day, day and sometimes week or 10mn. It's the first time a see so fast replication !

 
Posted : 10/01/2013 3:48 pm
f.fleche
(@f-flechearcinfo-com)
Posts: 79
Member Admin
Topic starter
 

Thx guys for your ideas
Actually they use OPC only
I'm also surprised by the frequency of the replication, and it's probably the reason if these messages.
These messages are not so frequent so it should not be an issue

 
Posted : 10/01/2013 10:14 pm
(@admin_doc72)
Posts: 493
Member Admin
 

Some additional info about error 4097 (since this is the only indication about this issue that you see with default traces activated):

Error code 4097 is Integrity database violation as key violation
It’s a mixed value with a mask 4096 + 1 (0x1001).

adRecIntegrityViolation 0x1000 Record not saved; user violated integrity constraints
adRecNew 0x1 Record is new

To summarize possible reasons for that error message:

  • Servers in a single-active-server historical association don't see each other (and therefore assume that they are both active).
  • Replication.
  • Timestamping at source with bad clock synchronisation.
  • To be confirmed: Usage of svMgrVarEnum. In the case that I am currently investigating it seems to me like the issue is caused by a miscalculation of a value's timestamp in the svMgrVarEnum under certain conditions (details still unclear). If you have seen this effect already, please drop me a small note.
 
Posted : 25/04/2013 12:12 pm