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

Troubleshooting Guide: SQL Server Error 13167

Why This Error Happens

Error 13167 typically occurs during Change Data Capture (CDC) or Service Broker operations when SQL Server 2025 cannot validate or synchronize metadata between the database engine and an associated external process, such as a capture job or replication agent. This is commonly caused by a corrupted system catalog entry, a permissions mismatch for the SQL Server service account, or a mismatch between database compatibility levels after an in-place upgrade to SQL Server 2025. In some cases, this error also surfaces when Windows Server 2025 security policies block the service account from accessing required registry or file system paths.

Step-by-Step Resolution Guide

Step 1: Verify Service Account Permissions

  • Open Services.msc on Windows Server 2025 / Windows 11 and confirm the SQL Server (MSSQLSERVER) service is running under the correct domain or local service account.
  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA and ensure the service account has Full Control permissions.
  • Restart the SQL Server service after applying permission changes:
  net stop MSSQLSERVER && net start MSSQLSERVER

Step 2: Rebuild or Repair the System Catalog Metadata

  • Open SQL Server Management Studio (SSMS) and run a consistency check against the affected database:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOREPAIR;
  • If corruption is confirmed, run:
  DBCC CHECKDB ('YourDatabaseName') WITH REPAIR_REBUILD;
  • Avoid using REPAIR_ALLOW_DATA_LOSS unless a verified backup exists.

Step 3: Validate Compatibility Level and CDC/Broker Configuration

  • Check the database compatibility level to ensure it aligns with SQL Server 2025 standards (level 170):
  SELECT name, compatibility_level FROM sys.databases WHERE name = 'YourDatabaseName';
  • If using Change Data Capture, disable and re-enable it to force a metadata refresh:
  EXEC sys.sp_cdc_disable_db;
  EXEC sys.sp_cdc_enable_db;

Step 4: Update SQL Server Cumulative Updates

  • Confirm you are running the latest Cumulative Update (CU) for SQL Server 2025 via SQL Server Setup or the Microsoft Update Catalog.
  • Install any pending CU and reboot Windows Server 2025 if prompted.

Alternative or Verification Steps

  • To verify the fix, re-run the failing job (CDC capture, Broker queue, or replication task) and check the SQL Server Error Log and Windows Event Viewer (Application log) for the absence of Error 13167.
  • If the error persists, restore the database from a known-good backup taken prior to the SQL Server 2025 upgrade, then reapply transaction logs to minimize data loss.