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

Troubleshooting Guide: SQL Server Error 5135 – FILESTREAM Path Cannot Be Used

Why This Error Happens

Error 5135 occurs when SQL Server 2025 attempts to create a FILESTREAM-enabled filegroup or database at a directory path that violates FILESTREAM’s structural requirements. This typically happens when the target path already exists as a non-empty directory, resides on a non-NTFS/ReFS volume, or the SQL Server service account lacks the necessary NTFS permissions to create and control the folder structure at that location. Additionally, the path may be invalid because it points to a root drive, a network share without proper configuration, or a location where the parent directory itself does not exist yet.

Step-by-Step Resolution Guide

Step 1: Verify FILESTREAM is Enabled at the Instance Level

  • Open SQL Server Configuration Manager on Windows Server 2025/Windows 11.
  • Navigate to SQL Server Services, right-click your instance, select Properties, then the FILESTREAM tab.
  • Ensure “Enable FILESTREAM for Transact-SQL access” and “Enable FILESTREAM for file I/O streaming access” are checked.
  • Confirm via T-SQL: run EXEC sp_configure 'filestream access level' and ensure the value is 2.

Step 2: Validate the Target Directory Path

  • Ensure the specified path (e.g., C:\SQLData\FileStreamData) does not already exist as a folder — SQL Server must create this final directory itself.
  • Confirm the parent directory (e.g., C:\SQLData\) exists and is on an NTFS or ReFS formatted volume.
  • Avoid using root paths like C:\ or D:\ directly; always use a subfolder.
  • Remove any trailing spaces or invalid characters from the path string in your CREATE DATABASE or ALTER DATABASE statement.

Step 3: Correct NTFS Permissions for the SQL Server Service Account

  • Open File Explorer, right-click the parent folder (e.g., C:\SQLData\), go to Properties > Security.
  • Add the SQL Server service account (e.g., NT SERVICE\MSSQLSERVER or your custom domain service account) with Full Control permissions.
  • Apply changes recursively and restart the SQL Server service to refresh permission tokens.

Step 4: Re-run the FILESTREAM Filegroup Creation Script

  • Execute a clean ALTER DATABASE command specifying the corrected path:
ALTER DATABASE YourDB
ADD FILE (NAME = FSGroup1, FILENAME = 'C:\SQLData\FileStreamData')
TO FILEGROUP FileStreamGroup;
  • Confirm no error 5135 is returned and the folder is auto-created by SQL Server.

Alternative or Verification Steps

  • Verify success by checking that the new FILESTREAM folder now contains a filestream.hdr file, confirming SQL Server has initialized the container correctly.
  • If the error persists, test using a local disk path instead of a mapped network drive or UNC path, as FILESTREAM has stricter validation against remote storage without explicit SMB 3.0 continuous availability configuration.