# Store and Forward Quarantined item- Duplicate Primary Key Error in Tag Historian

**URL:** <https://forum.inductiveautomation.com/t/store-and-forward-quarantined-item-duplicate-primary-key-error-in-tag-historian/114595>\
**Category:** Ignition\
**Created:** [March 20, 2026, 2:50pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-quarantined-item-duplicate-primary-key-error-in-tag-historian/114595 "2026-03-20T14:50:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahulsatpute5996](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@rahulsatpute5996](https://forum.inductiveautomation.com/u/rahulsatpute5996)\
**Post date:** [March 20, 2026, 2:50pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-quarantined-item-duplicate-primary-key-error-in-tag-historian/114595/1 "2026-03-20T14:50:07Z")

</div>

We are facing intermittent primary key violation error in ignition Tag Historian while storing data to SQL server.

Error observed: violation of primary key constraint cannot insert duplicate key.

Forword setting:

write size:25

write time:1sec

disk cache: Enabled

observed behaviour-

data already present in database with tagid and timestamp. however, store and Forword retries the same records again.

one more thing if batch size/write size 25 and if any records in batch fail will entire batch is retired or pending record only retired?

Appreciated any help.

---

<div class="post-metadata">

**Author:** ![Craig\_webber](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/craig_webber/32/62546_2.png) [@Craig\_webber](https://forum.inductiveautomation.com/u/Craig_webber)\
**Post date:** [March 20, 2026, 3:09pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-quarantined-item-duplicate-primary-key-error-in-tag-historian/114595/2 "2026-03-20T15:09:21Z")

</div>

Im working with ignition support on the exact same issue. What SQL server are you using ?

---

<div class="post-metadata">

**Author:** ![rahulsatpute5996](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@rahulsatpute5996](https://forum.inductiveautomation.com/u/rahulsatpute5996)\
**Post date:** [March 20, 2026, 3:28pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-quarantined-item-duplicate-primary-key-error-in-tag-historian/114595/3 "2026-03-20T15:28:11Z")

</div>

Hi, I am using Microsoft sql server 2016 SP1 (13.0), Express Edition.

---

<div class="post-metadata">

**Author:** ![ggross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ggross/32/12668_2.png) [@ggross](https://forum.inductiveautomation.com/u/ggross)\
**Post date:** [March 20, 2026, 4:02pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-quarantined-item-duplicate-primary-key-error-in-tag-historian/114595/4 "2026-03-20T16:02:55Z")

</div>

Which version of Ignition is this happening in and is it only a specific type of tag?  
In 8.3, we have a known issue where memory tags on startup are getting a duplicate history record processed because we are persisting the timestamp when it last changed after a restart now.

---

<div class="post-metadata">

**Author:** ![rahulsatpute5996](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@rahulsatpute5996](https://forum.inductiveautomation.com/u/rahulsatpute5996)\
**Post date:** [March 20, 2026, 4:11pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-quarantined-item-duplicate-primary-key-error-in-tag-historian/114595/5 "2026-03-20T16:11:13Z")

</div>

version is 8.1.26 and it’s not for specific tag random tag every time and tags are OPC tags.

---

<div class="post-metadata">

**Author:** ![ggross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ggross/32/12668_2.png) [@ggross](https://forum.inductiveautomation.com/u/ggross)\
**Post date:** [March 20, 2026, 5:00pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-quarantined-item-duplicate-primary-key-error-in-tag-historian/114595/6 "2026-03-20T17:00:55Z")

</div>

I would recommend reaching out to to support regarding the issue you are seeing. In looking at what has been fixed since the release you are currently using, there is 1 bug that could be related:

[Fixed in 8.1.27](https://inductiveautomation.com/downloads/releasenotes/8.1.27): Fixed issue where duplicate timestamps would be created when OPC quality changes.

---

<div class="post-metadata">

**Author:** ![Craig\_webber](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/craig_webber/32/62546_2.png) [@Craig\_webber](https://forum.inductiveautomation.com/u/Craig_webber)\
**Post date:** [April 2, 2026, 3:04pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-quarantined-item-duplicate-primary-key-error-in-tag-historian/114595/7 "2026-04-02T15:04:52Z")

</div>

@rahulsatpute5996 ive made some progress on this with the help of the support team. what we have found so far is that on postgres if there is a single violation in a batch insert then the entire batch is quarantined. If anyone else is using Postgres you can add these connection settings to prevent it:

> reWriteBatchedInserts=true;autosave=always;cleanupSavepoints=true

Still getting some real violations even with these settings but only the real violations are being quarantined.

---

<div class="post-metadata">

**Author:** ![Ervin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ervin/32/57644_2.png) [@Ervin](https://forum.inductiveautomation.com/u/Ervin)\
**Post date:** [September 22, 2026, 11:52am UTC](https://forum.inductiveautomation.com/t/store-and-forward-quarantined-item-duplicate-primary-key-error-in-tag-historian/114595/8 "2026-09-22T11:52:02Z")

</div>

Thanks for the suggestion

after adding the advised connection settings, instead of having the error message only, now it looks like I have the whole batch in a single quarantined item.s Reason:

> java.sql.BatchUpdateException: Batch entry 0 INSERT INTO sqlt\_data\_1\_2026\_09("tagid", "intvalue", "floatvalue", "stringvalue", "datevalue", "dataintegrity", "t\_stamp") VALUES(('51032'::int4),(NULL),('-2.4000000953674316'::double precision),(NULL),(NULL),('192'::int4),('1790073318272'::int8)),(('51311'::int4),(NULL),('0.8587962985038757'::double precision),(NULL),(NULL),('192'::int4),('1790072962527'::int8)),(('50408'::int4),(NULL),('229.77626037597656'::double precision),(NULL),(NULL),('192'::int4),('1790073180971'::int8)),(('50777'::int4),(NULL),('28.038827896118164'::double precision),(NULL),(NULL),('192'::int4),('1790073182608'::int8)),(('58618'::int4),(NULL),('15.269097328186035'::double precision),(NULL),(NULL),('192'::int4),('1790073181735'::int8)),(('50840'::int4),(NULL),('135.75521850585938'::double precision),(NULL),(NULL),('192'::int4),('1790073182623'::int8)),(('53977'::int4),(NULL),('0.0'::double precision),(NULL),(NULL),('192'::int4),('1790065966242'::int8)),(('53976'::int4),(NULL),('0.0'::double precision),(NULL),(NULL),('192'::int4),('1790065965774'::int8)),(('51049'::int4),(NULL),('14.84375'::double precision),(NULL),(NULL),('192'::int4),('1790073178560'::int8)),(('50562'::int4),(NULL),('4.929999828338623'::double precision),(NULL),(NULL),('192'::int4),('1790072468163'::int8)),(('51045'::int4),(NULL),('0.0'::double precision),(NULL),(NULL),('192'::int4),('1790073181042'::int8)),(('51336'::int4),(NULL),('0.0'::double precision),(NULL),(NULL),('192'::int4),('1790073181123'::int8)),(('50817'::int4),(NULL),('5.5225629806518555'::double precision),(NULL),(NULL),('192'::int4),('1790073181621'::int8)),(('51266'::int4),(NULL),('171.77552795410156'::double precision),(NULL),(NULL),('192'::int4),('1790073135995'::int8)),(('51267'::int4),(NULL),('171.20155334472656'::double precision),(NULL),(NULL),('192'::int4),('1790073135995'::int8)),(('51268'::int4),(NULL),('167.87548828125'::double precision),(NULL),(NULL),('192'::int4),('1790073136011'::int8)),(('51269'::int4),(NULL),('169.3426513671875'::double precision),(NULL),(NULL),('192'::int4),('1790073136018'::int8)),(('51270'::int4),(NULL),('169.74880981445312'::double precision),(NULL),(NULL),('192'::int4),('1790073136014'::int8)),(('51271'::int4),(NULL),('166.77745056152344'::double precision),(NULL),(NULL),('192'::int4),('1790073136001'::int8)),(('51272'::int4),(NULL),('171.7132110595703'::double precision),(NULL),(NULL),('192'::int4),('1790073136007'::int8)),(('52609'::int4),(NULL),('0.0'::double precision),(NULL),(NULL),('192'::int4),('1790073182474'::int8)),(('49999'::int4),(NULL),('22.461376190185547'::double precision),(NULL),(NULL),('192'::int4),('1790073180383'::int8)),(('50059'::int4),(NULL),('22.422405242919922'::double precision),(NULL),(NULL),('192'::int4),('1790073180419'::int8)),(('50060'::int4),(NULL),('22.793025970458984'::double precision),(NULL),(NULL),('192'::int4),('1790073180433'::int8)),(('51181'::int4),(NULL),('8.484999656677246'::double precision),(NULL),(NULL),('192'::int4),('1790073182691'::int8)),(('28394'::int4),('51'::int8),(NULL),(NULL),(NULL),('192'::int4),('1790073183405'::int8)),(('51087'::int4),(NULL),('8.077600479125977'::double precision),(NULL),(NULL),('192'::int4),('1790072934198'::int8)),(('50754'::int4),(NULL),('44.709999084472656'::double precision),(NULL),(NULL),('192'::int4),('1790073176940'::int8)),(('51761'::int4),(NULL),('8.932550430297852'::double precision),(NULL),(NULL),('192'::int4),('1790073183599'::int8)),(('50832'::int4),(NULL),('0.4286782741546631'::double precision),(NULL),(NULL),('192'::int4),('1790073180694'::int8)),(('49364'::int4),(NULL),('74.40999603271484'::double precision),(NULL),(NULL),('192'::int4),('1790073174776'::int8)),(('49352'::int4),(NULL),('43.51499938964844'::double precision),(NULL),(NULL),('192'::int4),('1790073175806'::int8)) was aborted: ERROR: duplicate key value violates unique constraint "sqlt\_data\_1\_2026\_09\_pkey" Detail: Key (tagid, t\_stamp)=(53977, 1790065966242) already exists. Call getNextException to see other errors in the batch.
