Troubleshooting Guide: SQL Server Error 5189 – TxF Resource Manager Undo Failure
Why This Error Happens
This error occurs when SQL Server 2025 attempts to roll back or recover a transaction using the Transactional NTFS (TxF) Resource Manager, but the underlying NT status code indicates the operation failed. This is most commonly caused by a corrupted or inaccessible TxF log on the volume hosting the database files, insufficient permissions for the SQL Server service account on the Resource Manager directory, or the TxF feature being disabled/deprecated on Windows Server 2025. Since Microsoft has deprecated TxF in recent Windows builds, filestream or FILETABLE-based databases relying on it may encounter undo failures during crash recovery.
Step-by-Step Resolution Guide
Step 1: Verify TxF Feature Status on the Host OS
- Open PowerShell as Administrator and run:
Get-WindowsOptionalFeature -Online -FeatureName TFC-TxF - Confirm the feature state is “Enabled.” If disabled, this explains the undo failure since TxF is deprecated and may be partially removed in Windows Server 2025 builds.
- If disabled, consider migrating away from FILESTREAM/FILETABLE features that depend on TxF, as re-enabling may not be supported long-term.
Step 2: Check Resource Manager Folder Permissions
- Navigate to the FILESTREAM data container path, typically found under your database’s filegroup directory (e.g.,
C:\SQLData\MyDB_FileStreamData\). - Right-click the folder, go to Properties > Security, and ensure the SQL Server service account (e.g.,
NT Service\MSSQLSERVER) has Full Control. - Run
icacls "C:\SQLData\MyDB_FileStreamData" /grant "NT SERVICE\MSSQLSERVER:(OI)(CI)F"to reset permissions if needed.
Step 3: Repair or Rebuild the Transactional Resource Manager Log
- Stop the SQL Server service via
services.mscornet stop MSSQLSERVER. - Locate the hidden
$TxfLogfolder on the root of the volume hosting your database files (e.g.,D:\$TxfLog). - If corruption is suspected, run
chkdsk D: /f /rto repair the NTFS volume and its transactional log structures, then restart the SQL Server service.
Step 4: Restore the Database from a Clean Backup
- If the error persists after repair attempts, the FILESTREAM container may be unrecoverable.
- Restore the affected database from the last known good full backup plus transaction logs using
RESTORE DATABASE MyDB FROM DISK = 'E:\Backups\MyDB.bak' WITH NORECOVERY, followed by applying log backups. - Bring the database online with
RESTORE DATABASE MyDB WITH RECOVERY.
Alternative or Verification Steps
- After applying fixes, run
DBCC CHECKDB('MyDB') WITH NO_INFOMSGS, ALL_ERRORMSGSto confirm no further corruption exists and that the database comes online cleanly. - As a long-term alternative, migrate FILESTREAM data to standard BLOB storage or Azure Blob Storage integration, since TxF dependency is being phased out and will continue causing instability on newer Windows Server releases.