Network Management

Orion.LogMgmt.Maintenance fails due to deadlocks on SQL 2016

The Orion.LogMgmt.Maintenance step in Database Maintenance may fail due to deadlocks on SQL 2016.

First published date

3/7/2023 8:51 PM

Last published date

2/25/2026 4:39 PM

Overview

In Log Manager, the LogMgmt step during Database Maintenance may fail due to SQL deadlocks.

The C:\ProgramData\SolarWinds\Logs\Orion\swdebugMaintenance.log files should contain the following error:

... ERROR SolarWinds.Orion.LogMgmt.Maintenance.LogMaintenancePlugin - Failed to ... in Log , Attempt
#1, ErrorNumber 1205 Retrying...
System.Data.SqlClient.SqlException (0x80131904): Transaction (Process ID 454) was deadlocked on lock
resources with another process and has been chosen as the deadlock victim. Rerun the transaction
.

Product section

Log Analyzer

Cause

The SQL deadlock is caused by a bug in Microsoft SQL Server. See this Microsoft KB for details.

Resolution

Turn on trace flag 1237 on the SQL server running your Orion Log database, if not already set. 
Check the status of the trace flag by running the following SQl query:

DBCC TRACESTATUS (1237, -1)

The following result means that trace flag 1237 has not been set:
TraceFlagStatusGlobalSession
1237000

To set trace flag 1237:
1. Open SQL Server Configuration Manager.
2. Select the SQL Server Services node.
3. Right-click on SQL Server (instance_name) and select Properties.
4. Go to the Startup Parameters tab.
5. Fill Specify a startup parameter field with -T1237, click Add, and hit OK..
6. Restart the SQL server (instance_name) service.