Frequently Asked Questions
Frequently Asked Questions
"Violation of PRIMARY KEY constraint... Cannot insert duplicate key in object..." errors with unpatched Microsoft SQL Server
Posted by Lassi Lehtinen (M-Files) on 20 September 2018 11:59 AM

If you are using Microsoft SQL Server as the database engine for your M-Files document vault and suddenly many operations in M-Files start to produce errors like

"Violation of PRIMARY KEY constraint.. Cannot insert duplicate key in object..." 

then the first thing to check is your Microsoft SQL Server version.

The most likely reason for the error is that your Microsoft SQL Server version does not include this fix from Microsoft (Sequence object generates duplicate sequence values when SQL Server 2012 or SQL Server 2014 is under memory pressure).

To solve the issue, your SQL Server should be updated with latest updates from Microsoft and M-Files Server service should be restarted afterwards. Use e.g. the latest cumulative update for your SQL Server version. The nature of this error is such that these operations are often enough to solve it, but not always (enough retries of the failing operation can make the error disappear at some point but without SQL Server update, it is likely to occur again).

In case you have followed the above guidance and the problem still persists, the vault database may need also manual fixes. Please contact in that case.

(11 vote(s))
This article was helpful
This article was not helpful

Help Desk Software by Kayako case