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

Troubleshooting Guide: SQL Server Error 9716 — Conversation Group Reference Mismatch

Why This Error Happens

Error 9716 occurs when Service Broker detects an internal inconsistency between the conversation group metadata and the actual conversation handles referencing it, typically caused by abrupt transaction rollbacks, improper END CONVERSATION handling, or corruption in the sys.conversation_endpoints system views. This can also surface after an unclean shutdown, forced failover, or restoring a database with an inconsistent Service Broker state. In most cases, the root cause is orphaned conversation handles that were not properly cleaned up due to interrupted queue processing or disabled Service Broker activation during a critical transaction.

Step-by-Step Resolution Guide

Step 1: Verify Service Broker Status and Identify Affected Conversations

  • Run SELECT * FROM sys.conversation_endpoints WHERE conversation_handle = '<handle_from_error>'; to confirm the orphaned state.
  • Check SELECT is_broker_enabled FROM sys.databases WHERE name = '<YourDatabaseName>'; to ensure Service Broker is active.
  • Review the SQL Server error log at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for correlating timestamps and related 9617/9641 Service Broker warnings.

Step 2: Clean Up Orphaned Conversation Handles

  • Execute END CONVERSATION '<conversation_handle>' WITH CLEANUP; for each handle referenced in the error message.
  • If multiple handles are affected, script this using a cursor against sys.conversation_endpoints where state = 'CD' (closed) or state_desc = 'DISCONNECTED_INBOUND'.
  • Avoid running this during peak transaction hours as it forces an immediate teardown of the conversation group.

Step 3: Rebuild Service Broker Metadata Consistency

  • Run DBCC CHECKDB('<YourDatabaseName>') WITH NO_INFOMSGS, ALL_ERRORMSGS; to confirm no underlying page-level corruption exists in the system catalog.
  • If corruption is found, restore from the last known good backup via SQL Server Management Studio (SSMS) 21 using Tasks > Restore > Database.
  • Alternatively, run ALTER DATABASE <YourDatabaseName> SET NEW_BROKER WITH ROLLBACK IMMEDIATE; only if conversation history is disposable, as this resets the Broker GUID and clears all stale conversation groups.

Step 4: Update SQL Server 2025 Cumulative Patches

  • Navigate to Microsoft Update Catalog and verify you are on the latest Cumulative Update (CU) for SQL Server 2025, as early RTM builds had a known race condition in the sys.transmission_queue cleanup routine.
  • Install via the standalone setup file and restart the MSSQLSERVER service through services.msc on Windows Server 2025.

Alternative or Verification Steps

  • Verify the Fix: Re-run the query against sys.conversation_endpoints for the specific handle; if the result set is empty, the conversation group has been successfully purged.
  • Alternative Fallback: If END CONVERSATION ... WITH CLEANUP fails due to a locked transaction, restart the SQL Server instance in single-user mode (sqlservr.exe -m) to force-release the lock on the Broker queue before retrying the cleanup script.