Error 13405 'Cannot insert duplicate key in object' can occur when submitting indexing tasks with more than 1 volume

book

Article ID: 100050669

calendar_today

Updated On:

Description

Error Message

Type :        Error
Event :       13405
Source :      Enterprise Vault
Category :    Directory Service
User :        N/A
Computer :    EVServer1.domain.local
Description:
A constraint violation error was detected while accessing the Vault Database 'EnterpriseVaultDirectory' (Internal reference: {CADODataAccess::ExecuteSQLCommand} [d:\builds\16_\ev\vh-12.5-m\sources\source\common\adointerface\adodataaccess.cpp, lines {1326,1328,1347,1365}, built Jul 29 08:56:34 2020]):
Description:  
Violation of PRIMARY KEY constraint 'PK_SubTask'. Cannot insert duplicate key in object 'dbo.SubTask'. The duplicate key value is (192B99A1119B94A3E9D4C5845F59F26151013b00Vault_site).

SQL Command:

CreateIndexingSubTasks

Additional Microsoft supplied information:

Source:       Microsoft OLE DB Driver for SQL Server
Number:       0x80040e2f
SQL State:    23000
Native Error: 00002627
HRESULT       0x80040e2f

 

Cause

When populating the Subtask table, a function is executed to get a unique GUID entry for each Archive\Index volume which was selected for processing. However,  MS SQL Server can wrongly execute the function just once and cache the value instead of generating a new value for each record.
 

Resolution

Upgrade SQL 2019 to latest Supported CU version. As of June 2021 it is CU10

Please refer to the Enterprise Vault Compatibility Guide for the latest supported releases.

Workaround
As a workaround, the compatibility level of the Enterprise Vault SQL Databases can be changed to SQL Server 2017 (140). This can be done via SQL Management Studio - Database Properties - Options

 

Issue/Introduction

When managing indexes, creating a Rebuild, Verify or Synchronize Task against multiple Archives\Indexes can fail with Error 13405 when the Subtasks are getting created because of a duplicated value in the Subtask table located in the EnterpriseVaultDirectory database.

The error was observed with MS SQL Server 2019 Base version and was occurring even when the Subtask table was empty.