Troubleshooting Guide: SQL Server Error 13203 (“TO SERVICE”)
Why This Error Happens
Error 13203 typically occurs when SQL Server Service Broker attempts to establish a dialog “TO SERVICE” but fails to resolve or validate the target service due to a missing, disabled, or misconfigured Service Broker route, certificate, or endpoint. This is commonly caused by corrupted Service Broker metadata, a mismatched or expired security certificate used for dialog encryption, or the target database having Service Broker disabled (is_broker_enabled = 0). In Windows Server 2025 / Windows 11 environments, this can be compounded by stricter TLS/certificate validation policies that reject legacy broker certificates.
Step-by-Step Resolution Guide
Step 1: Verify Service Broker Is Enabled on the Database
- Run the following query to check broker status:
SELECT name, is_broker_enabled FROM sys.databases WHERE name = 'YourDatabaseName';
- If
is_broker_enabledreturns0, enable it with:
ALTER DATABASE YourDatabaseName SET ENABLE_BROKER;
- Ensure no active connections are blocking the ALTER statement; use
WITH ROLLBACK IMMEDIATEif necessary.
Step 2: Validate the Service and Route Configuration
- Confirm the target service exists:
SELECT * FROM sys.services WHERE name = 'YourServiceName';
- Check that a valid route is defined pointing to the correct broker instance or address:
SELECT * FROM sys.routes;
- If missing, recreate the route using
CREATE ROUTEwith the correctADDRESSandSERVICE_NAMEparameters.
Step 3: Check and Renew Service Broker Certificates
- Verify certificate expiration and validity:
SELECT name, expiry_date FROM sys.certificates WHERE name LIKE '%Broker%';
- If expired or invalid, drop and recreate the certificate, then re-establish the master key backup.
- Restart the SQL Server service via
services.mscor:
Restart-Service -Name 'MSSQLSERVER'
Step 4: Review SQL Server Error Logs and Firewall Rules
- Open SQL Server Configuration Manager and confirm the Service Broker endpoint port (commonly 4022) is active and not blocked.
- Check Windows Defender Firewall on Windows Server 2025 for inbound/outbound rules blocking TCP 4022:
New-NetFirewallRule -DisplayName "SQL Broker" -Direction Inbound -Protocol TCP -LocalPort 4022 -Action Allow
- Cross-reference SQL Server error logs (
ERRORLOGinC:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\) for correlating Broker failure messages.
Alternative or Verification Steps
- To verify the fix, send a test message between services using
BEGIN DIALOGandSEND ON CONVERSATION, then confirm successful delivery viasys.transmission_queue(it should return no stuck rows). - If the issue persists, as an alternative, disable and re-enable Service Broker entirely using
ALTER DATABASE SET DISABLE_BROKERfollowed byENABLE_BROKER, then rebuild the route and certificate from scratch.