Overview
Following kind of error message is seen when trying to modify the object and save the changes in M-Files Desktop:
MCommand.h, 681, Error 2627, Level 14, State 1, Procedure -, Line 1, Message: Violation of PRIMARY KEY constraint 'PK_OVPV'. Cannot insert duplicate key in object 'dbo.OVPV'. The duplicate key value is (A, B, C, D, 1). (ERROR: 50000, SQLSTATE: 42000) (0x80040E14)
(M-Files 22.6.11534.5 2022-07-11T09:19:41.190Z)
Please note! Read the error stack carefully, this article is valid only for 'PK_OVPV' errors, not e.g. 'PK_OBJECTVERSIONT0LR' or 'PK_OPT0P1347LR' errors.
Solution
To solve this issue, M-Files database needs to be modified.
If this is MS SQL vault, please run the following queries with SQL Management studio, save the results to csv-files and send those to M-Files Support:
select * from objecttypeitem where objecttype = A and id = B
select * from objecttypeitemversion where id_objecttype = A and id_objectpart = B
select * from ovpv where ov_objecttype = A and ov_objectpart = B and ov_versionpart = C
Please replace A, B and C with values seen in the error message.
If this Firebird vault, you need to send metadata copy of the vault to M-Files Support using Cryptshare.
