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

Troubleshooting Guide: Error 5198 – UNC Path Not Supported in Failover Clustered Environment

Why This Error Happens

This error occurs because SQL Server 2025, when running in a Windows Server Failover Cluster (WSFC) configuration, does not allow database files (data, log, or filestream) to be created or attached directly from a UNC path (\\servername\share) in certain contexts, particularly when the resource lacks proper cluster-aware validation. This typically happens when a DBA attempts to run CREATE DATABASE, ALTER DATABASE, or RESTORE commands pointing to a network share without registering that share as a valid dependent cluster resource. Additionally, this can occur if the File Share Witness or Scale-Out File Server configuration is improperly mapped to the SQL Server role in Failover Cluster Manager.

Step-by-Step Resolution Guide

Step 1: Verify the Current Path Configuration

  • Check the exact T-SQL command that triggered Error 5198 (e.g., CREATE DATABASE... ON (FILENAME = '\\FileServer\Share\data.mdf')).
  • Confirm if the target path is a standard UNC path or a Cluster Shared Volume (CSV) mistakenly formatted as UNC.
  • Run Get-ClusterResource in PowerShell on Windows Server 2025 to see if the file share is currently recognized by the cluster.

Step 2: Register the File Share as a Cluster Resource

  • Open Failover Cluster Manager on Windows Server 2025.
  • Navigate to Storage > Disks and ensure the UNC path corresponds to a Scale-Out File Server (SOFS) or a properly clustered file share resource.
  • If using a standard file share, add it via PowerShell: Add-ClusterSharedVolume -Name "Cluster Disk 1".
  • Ensure the SQL Server service account has explicit Full Control NTFS and Share permissions on the target UNC folder.

Step 3: Update SQL Server Trace Flags and Registry Permissions

  • In some Windows Server 2025 cluster configurations, SQL Server blocks UNC paths unless Trace Flag 1807 is enabled, which permits UNC path usage for database files.
  • Open SQL Server Configuration Manager > right-click the SQL Server Service > Properties > Startup Parameters.
  • Add the parameter: -T1807.
  • Restart the SQL Server service for the trace flag to take effect.

Step 4: Re-validate the Cluster Role Dependency

  • Go back to Failover Cluster Manager, select the SQL Server role, and click Add Storage or Add Resource > File Share.
  • Ensure the UNC path is listed as a Dependency for the SQL Server resource group; if it is missing, right-click the SQL Server resource, select Properties > Dependencies, and add the file share resource.
  • Bring the resource group Online to apply the dependency chain.

Alternative or Verification Steps

  • To verify the fix, re-run the original CREATE DATABASE or RESTORE command pointing to the UNC path; if successful, the database will mount without throwing Error 5198.
  • As an alternative, if cluster dependency configuration is restricted by security policy, migrate the database files to a local Cluster Shared Volume (CSV) path (e.g., C:\ClusterStorage\Volume1\MSSQL\Data) instead of relying on an external UNC share.