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

Why This Error Happens

Error 13090 occurs when SQL Server’s Service Broker component cannot validate or bind a message contract to an existing service or queue, typically because the contract definition was dropped, altered, or never fully committed during a transaction rollback. This frequently happens after an incomplete schema migration or when a login lacks the REFERENCES permission on the CONTRACT object. In Windows Server 2025 environments, this is also triggered by Service Broker endpoints losing certificate trust after a Group Policy update rotates local machine certificates.

Step-by-Step Resolution Guide

Step 1: Verify Contract Existence and Binding

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run the following query to confirm the contract is still registered:
  SELECT * FROM sys.service_contracts WHERE name = 'YourContractName';
  • If no rows return, the contract was dropped and must be recreated using CREATE CONTRACT.

Step 2: Check and Repair Permissions

  • Confirm the executing login has rights on the contract:
  SELECT * FROM fn_my_permissions('YourContractName', 'CONTRACT');
  • Grant missing permissions explicitly:
  GRANT REFERENCES ON CONTRACT::YourContractName TO [DOMAIN\ServiceAccount];
  • Restart the SQL Server service via services.msc to flush cached permission tokens.

Step 3: Rebuild Service Broker Routing and Certificates

  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\ and confirm the master database certificate files are intact.
  • Re-issue the Service Broker certificate if corruption is suspected:
  ALTER MASTER KEY REGENERATE ENCRYPTION BY SERVICE MASTER KEY;
  • Re-enable Broker on the database if it was disabled during the error:
  ALTER DATABASE YourDB SET ENABLE_BROKER;

Step 4: Clear Transmission Queue Errors

  • Query the transmission queue for stuck messages referencing the broken contract:
  SELECT * FROM sys.transmission_queue;
  • Clear any poisoned messages tied to the invalid contract ID before retrying the operation.

Alternative or Verification Steps

  • Verify the fix by sending a test message through the affected service using SEND ON CONVERSATION and confirming it reaches the target queue without a 13090 error in the SQL Server Error Log (Event Viewer > Applications and Services Logs > MSSQLSERVER).
  • If the error persists, drop and fully recreate the Service Broker service, queue, and contract chain in the correct dependency order (Message Type → Contract → Queue → Service).