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

Troubleshooting Guide: SQL Server Error 9626 (Service Broker Internal Error)

Why This Error Happens

Error 9626 occurs when the Service Broker engine detects that an internal object—such as a conversation endpoint, queue, or dialog—is in a state that does not match the operation being attempted, usually due to internal metadata corruption or a race condition during high-concurrency message processing. This is often triggered by abrupt shutdowns, storage-level corruption affecting system tables (sys.conversation_endpoints, sys.transmission_queue), or a bug/edge-case in the Service Broker transport layer interacting with Windows Server 2025 networking stack. In rare cases, it can also be triggered by conflicting third-party antivirus or EDR software intercepting named pipes or TCP ports used by Service Broker.

Step-by-Step Resolution Guide

Step 1: Check SQL Server and Windows Event Logs

  • Open SQL Server Management Studio (SSMS) and navigate to Management > SQL Server Logs.
  • Cross-reference the timestamp of Error 9626 with the Windows Event Viewer (Application and System logs) to check for disk I/O errors, memory dumps, or hardware-level warnings.
  • Look for accompanying errors like 824 (I/O error) or 3313 (recovery error), which indicate underlying corruption rather than a standalone Service Broker glitch.

Step 2: Run Database Consistency Checks (DBCC CHECKDB)

  • Execute the following command to scan for corruption in the system and user databases:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is found specifically in Service Broker objects, you may need to run DBCC CHECKDB with the REPAIR_ALLOW_DATA_LOSS option, but only after taking a full backup, as this can result in the loss of unprocessed messages.

Step 3: Disable and Re-enable Service Broker

  • Sometimes resetting the Broker GUID and clearing the message queue resolves the “stuck” state.
  • Run the following T-SQL to disable broker:
  ALTER DATABASE YourDatabaseName SET DISABLE_BROKER;
  • Re-enable it immediately after:
  ALTER DATABASE YourDatabaseName SET ENABLE_BROKER;
  • Verify the is_broker_enabled flag is set to 1 in sys.databases.

Step 4: Clear the Transmission Queue and Restart the Service

  • Navigate to Services.msc on Windows Server 2025 and restart the SQL Server (MSSQLSERVER) service to clear any locked in-memory objects related to the broker.
  • If the queue remains stuck, manually purge expired conversations using:
  END CONVERSATION 'conversation_handle' WITH CLEANUP;
  • Check sys.transmission_queue to ensure the error count is decreasing after the restart.

Step 5: Apply the Latest Cumulative Update (CU)

  • Verify your current build number by running SELECT @@VERSION;.
  • Navigate to the Microsoft Update Catalog and download the latest Cumulative Update for SQL Server 2025, as this specific internal state error is frequently patched in service packs related to the new Broker threading model.
  • Install the patch during a scheduled maintenance window, as it requires a service restart.

Alternative or Verification Steps

  • Verification: After restarting the service, query sys.dm_broker_queue_monitors to confirm that queue monitors are in a RUNNING state rather than DISABLED or UNKNOWN.
  • Alternative: If the error persists after a CU update, restore the specific database from the last known good backup taken before the corruption occurred, as this is often faster than manually rebuilding Service Broker objects.