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

Troubleshooting Guide: Error 13172 – GET CONVERSATION GROUP Failure in SQL Server 2025

Why This Error Happens

Error 13172 typically occurs when the Service Broker message queue referenced by the GET CONVERSATION GROUP statement has become corrupted, disabled, or is in a state where internal metadata cannot be resolved. This often results from queue corruption following an unexpected server shutdown, a damaged system catalog, or a queue that has been disabled due to poison message handling. In some cases, insufficient permissions on the queue or an inconsistency between the sys.conversation_endpoints and sys.transmission_queue tables can also trigger this error.

Step-by-Step Resolution Guide

Step 1: Verify Service Broker Status and Queue Health

  • Run SELECT is_broker_enabled FROM sys.databases WHERE name = 'YourDatabaseName'; to confirm Service Broker is active.
  • Check if the queue is disabled due to poison messages: SELECT name, is_receive_enabled FROM sys.service_queues;
  • If is_receive_enabled returns 0, the queue has been auto-disabled.

Step 2: Re-enable and Rebuild the Affected Queue

  • Re-enable the queue manually using: ALTER QUEUE YourQueueName WITH STATUS = ON;
  • If corruption is suspected, rebuild the queue by dropping and recreating it (ensure you back up conversation data first): DROP QUEUE YourQueueName; CREATE QUEUE YourQueueName;
  • Reattach the queue to its associated service with CREATE SERVICE or ALTER SERVICE as needed.

Step 3: Run Consistency Checks on the Database

  • Execute DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to detect underlying corruption in system tables.
  • On Windows Server 2025, confirm the SQL Server service account has full read/write access to the data and log file directories under C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\.
  • Restart the SQL Server service via services.msc or Restart-Service -Name 'MSSQLSERVER' in PowerShell (run as Administrator) after applying fixes.

Step 4: Validate Permissions on Service Broker Objects

  • Confirm the executing user has RECEIVE permission on the queue: GRANT RECEIVE ON YourQueueName TO [YourUserOrRole];
  • Verify the user also holds VIEW DEFINITION rights on the associated conversation group if group security is restricted.

Alternative or Verification Steps

  • Confirm resolution by re-running the original GET CONVERSATION GROUP query inside a RECEIVE statement; it should now return the conversation group ID without throwing Error 13172.
  • If the issue persists, restore the database from a known-good backup taken before the corruption occurred, then re-apply any transaction logs to minimize data loss.