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

Troubleshooting Guide: SQL Server Error 5521 (Transaction File System Resource Manager Retrieval Failure)

Why This Error Happens

Error 5521 occurs when SQL Server 2025 attempts to communicate with the Kernel Transaction Manager (KTM) and the Transaction File System Resource Manager (TxF RM) on the underlying NTFS volume, but the operation fails with an NT status code. This typically happens because the TxF feature has been disabled at the volume or OS level, the resource manager metadata is corrupted, or the SQL Server service account lacks the necessary permissions to access the $Txf system directory. In some cases, this also surfaces after an in-place OS upgrade to Windows Server 2025 or Windows 11, where TxF support has been deprecated or restricted by default.

Step-by-Step Resolution Guide

Step 1: Verify TxF Status on the Target Volume

  • Open an elevated Command Prompt and run fsutil resource info C:\ (replace C:\ with the actual volume hosting your database files).
  • Confirm whether the output returns a valid Resource Manager GUID or an error indicating TxF is disabled.
  • If TxF is disabled, note that Microsoft has deprecated this feature in newer Windows builds, which directly correlates with Error 5521.

Step 2: Re-enable or Repair the Resource Manager

  • If TxF support is still required, run fsutil resource create C:\ to recreate the Resource Manager object on the volume.
  • Stop any processes using the volume, then attempt fsutil resource start C:\ to restart the TxF Resource Manager.
  • If the RM logs are corrupted, you may need to run fsutil resource recover C:\ to force a log recovery pass.

Step 3: Validate SQL Server Service Account Permissions

  • Navigate to the volume root and locate the hidden $Txf folder (requires enabling “Show hidden files” and “Show protected operating system files” in File Explorer options).
  • Right-click the SQL Server data/log directory (e.g., D:\SQLData\) and verify the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control at the NTFS level.
  • Apply permissions recursively and restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 4: Check for OS-Level TxF Deprecation

  • Since TxF is marked for removal in modern Windows builds, confirm via dism /online /get-features whether the “TxF” optional feature is present and enabled on Windows Server 2025.
  • If TxF is fully removed from your build, migrate any workloads relying on transacted file operations away from TxF-dependent configurations (e.g., certain legacy FILESTREAM or backup compression setups).

Step 5: Rebuild the Affected Database Files if Necessary

  • If the error persists only on specific database files, detach the database using sp_detach_db.
  • Move the physical .mdf/.ldf files to a volume with confirmed working TxF support (or no TxF dependency).
  • Reattach the database using sp_attach_db and monitor the SQL Server error log for recurrence of Error 5521.

Alternative or Verification Steps

  • To verify the fix, run fsutil resource info <Volume> again and confirm a clean status with no pending transactions, then check the SQL Server error log (ERRORLOG) for absence of Error 5521 after a full service restart.
  • If TxF cannot be restored on Windows Server 2025 due to deprecation, the recommended alternative is to migrate the database files to a volume configuration that doesn’t invoke TxF-dependent SQL Server features, as Microsoft advises against new dependencies on this legacy technology.