How to fix Error 5287 on Windows Server 2025 / Windows 11

Troubleshooting Guide: Error 5287 – DBCC THROWERROR Bypass Exception

Why This Error Happens

Error 5287 is triggered internally when DBCC THROWERROR is invoked as part of SQL Server’s internal consistency checking or diagnostic test harness, typically during DBCC CHECKDB operations or automated test frameworks. This is a benign, informational message that SQL Server 2025 raises to validate that error-handling and messaging pathways are functioning correctly. It does not indicate database corruption, missing permissions, or a system failure, but repeated unexpected occurrences in production logs may point to a third-party monitoring tool or script incorrectly invoking DBCC commands with debug/test flags.

Step-by-Step Resolution Guide

Step 1: Confirm the Message is Informational

  • Open SQL Server Error Log via SSMS: Management > SQL Server Logs.
  • Search for “Error: 5287” and confirm the accompanying text explicitly states “This is an informational message only. No user action is required.”
  • Cross-reference the timestamp with any scheduled DBCC CHECKDB, CHECKTABLE, or CHECKALLOC jobs in SQL Server Agent.

Step 2: Identify the Source Trigger

  • Check SQL Server Agent Job History (Agent > Job Activity Monitor) for jobs running DBCC commands around the time the error appears.
  • Run the following query to inspect recent DBCC activity from default trace or Extended Events:
SELECT * FROM sys.fn_trace_gettable('C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\log.trc', default)
WHERE EventClass = 22;
  • Determine if a third-party backup, integrity-check, or monitoring tool (e.g., Ola Hallengren’s maintenance scripts) is explicitly calling DBCC with internal test parameters.

Step 3: Suppress Unnecessary Logging Noise (Optional)

  • If the message is cluttering logs but confirmed harmless, adjust Extended Events session filtering to exclude Error 5287 from alerting pipelines.
  • Navigate to Management > Extended Events > Sessions, edit your monitoring session, and add a filter: error_number <> 5287.
  • Avoid disabling the SQL Server Error Log itself — only filter at the alerting/monitoring layer (e.g., SCOM, Redgate, SolarWinds).

Step 4: Validate Database Integrity Regardless

  • Even though the error is informational, run a manual integrity check to rule out coincidental timing with real corruption:
DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review output for actual error codes (e.g., 8928, 8939) which would indicate real corruption, distinct from 5287.

Step 5: Update SQL Server 2025 Cumulative Updates

  • Navigate to Microsoft Update Catalog and verify you are on the latest Cumulative Update (CU) for SQL Server 2025.
  • Apply via: Setup.exe /ACTION=Patch /IAcceptSQLServerLicenseTerms /QS /INSTANCENAME=MSSQLSERVER.
  • This ensures any internal diagnostic messaging quirks tied to DBCC THROWERROR in early builds are patched.

Alternative or Verification Steps

  • Verify resolution by monitoring the SQL Server Error Log for 24–48 hours to confirm Error 5287 only appears alongside expected DBCC maintenance windows and causes no job failures or alert escalations.
  • If the message persists outside of known DBCC jobs, run SELECT * FROM sys.dm_os_ring_buffers WHERE ring_buffer_type = 'RING_BUFFER_EXCEPTION' to trace the originating session ID and correlate it with specific application connections.