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

Troubleshooting Guide: SQL Server Error 5186 – TxF Resource Manager Startup Failure

Why This Error Happens

Error 5186 occurs when SQL Server 2025 attempts to initialize the Transactional File System (TxF) Resource Manager on a database that relies on filestream or filetable functionality, but the underlying NTFS volume cannot process the transaction log correctly. This is typically caused by the TxF feature being disabled at the OS level (common in newer Windows Server 2025 / Windows 11 builds where TxF is deprecated), corrupted transaction metadata in the $TxfLog system directory, or insufficient permissions for the SQL Server service account on the volume hosting the database files. The NT status code accompanying the error usually points to STATUS_OBJECT_NAME_NOT_FOUND or STATUS_ACCESS_DENIED, confirming either a missing resource manager log or a security context mismatch.

Step-by-Step Resolution Guide

Step 1: Verify TxF Status on the Volume

  • Open an elevated Command Prompt and run fsutil resource info C: (replace C: with the drive hosting your database files) to check if a resource manager already exists.
  • Confirm TxF is not disabled by checking fsutil behavior query DisableTxfAndTm — a return value of 1 means TxF is disabled system-wide.
  • If disabled, re-enable temporarily using fsutil behavior set DisableTxfAndTm 0, then restart the server.

Step 2: Check and Repair NTFS Volume Integrity

  • Run chkdsk C: /f /r on the affected volume to repair file system inconsistencies, especially within the $TxfLog and $Tops metadata streams.
  • Schedule the check on next reboot if the volume is in use: type Y when prompted.
  • After reboot, re-run fsutil resource info C: to confirm the resource manager initializes without error.

Step 3: Validate SQL Server Service Account Permissions

  • Open Computer Management > Local Users and Groups, confirm the SQL Server service account has Full Control on the database directory (e.g., D:\SQLData\).
  • Alternatively, use icacls "D:\SQLData" /grant "NT SERVICE\MSSQLSERVER":(OI)(CI)F to explicitly grant permissions.
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 4: Rebuild the Resource Manager (If Corrupted)

  • If the error persists, delete the orphaned TxF resource manager handle using fsutil resource delete C: (ensure no active transactions are pending first).
  • Reboot the server to allow SQL Server to recreate the resource manager cleanly on next startup.
  • Monitor the SQL Server Error Log (Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for confirmation that Error 5186 no longer appears.

Alternative or Verification Steps

  • Verify the fix by querying SELECT * FROM sys.dm_tran_current_transaction; in SSMS to confirm transactional operations execute without triggering Event ID 5186 in the Windows Event Viewer (System log).
  • If TxF remains unstable due to Microsoft’s ongoing deprecation of the feature, consider migrating filestream-dependent tables to FILESTREAM with FILETABLE disabled or moving to BLOB storage via Azure Blob integration, as TxF is not guaranteed in future Windows Server releases.