Why This Error Happens
Error 11209 occurs when Service Broker receives a message for a conversation handle or dialog ID that no longer exists in the sys.conversation_endpoints table, typically because the conversation was already ended, timed out, or rolled back on the receiving end. This frequently happens due to orphaned conversations caused by application logic that fails to properly handle END CONVERSATION commands, or due to message retention settings sending traffic to a stale endpoint. It can also surface after a database restore or mirroring failover where conversation state became desynchronized between the initiator and target databases.
Step-by-Step Resolution Guide
Step 1: Identify the Source of the Orphaned Conversation
- Run the following query to check for the conversation ID referenced in the error message:
SELECT * FROM sys.conversation_endpoints WHERE conversation_id = '<GUID-from-error>';- If no rows return, the conversation has already been terminated on this instance, confirming the message is arriving for a dead endpoint.
- Check the SQL Server Error Log (via
%lsorigin field) to identify which remote service broker instance is sending the stale message.
Step 2: Clear Poison Messages from the Queue
- Inspect the receiving queue for a backlog of undeliverable messages:
SELECT * FROM [YourQueueName] WHERE conversation_handle = '<handle>';- If messages are stuck, disable and re-enable the queue to clear the poison message flag:
ALTER QUEUE [YourQueueName] WITH STATUS = OFF;ALTER QUEUE [YourQueueName] WITH STATUS = ON;- On Windows Server 2025, ensure the SQL Server Service Broker service account has not been affected by recent Group Policy changes restricting network service permissions.
Step 3: Resynchronize Service Broker Routing and Endpoints
- Verify that routes and remote service bindings are still valid after any recent failover or restore:
SELECT * FROM sys.routes;SELECT * FROM sys.remote_service_bindings;- Drop and recreate any routes pointing to outdated server instances or IP addresses (common after Windows Server 2025 network stack updates change adapter GUIDs).
- Restart the SQL Server Broker task using:
ALTER DATABASE [YourDB] SET DISABLE_BROKER;ALTER DATABASE [YourDB] SET ENABLE_BROKER;
Step 4: End Lingering Conversations Manually
- For conversations still active locally but mismatched with the remote side, force termination to reset state:
END CONVERSATION '<conversation_handle>' WITH CLEANUP;- This clears corrupted or “zombie” conversation state without requiring a full database restart.
Alternative or Verification Steps
- Verify the fix by monitoring the SQL Server Error Log and
sys.conversation_endpointsfor 24 hours to confirm Error 11209 no longer appears and queue depth remains stable. - If the error persists across a linked Availability Group, consider rebuilding the Service Broker GUID using
ALTER DATABASE [YourDB] SET NEW_BROKER(note: this is a destructive operation that resets all conversation state and should only be used in non-production or after confirming no in-flight transactions are needed).