Troubleshooting Guide: Error 5194 — FILESTREAM Log File Size Must Be Greater Than or Equal to 1 MB
Why This Error Happens
This error occurs when SQL Server 2025 attempts to create, attach, or restore a FILESTREAM-enabled database, but the log file size specified for the FILESTREAM container is set below the required 1 MB minimum threshold. This typically happens due to a misconfigured database creation script, an incorrectly edited model database template, or a manual override in the file growth settings that sets the initial size to 0 KB or a value under 1024 KB. It can also surface during database migration or restore operations where the original FILESTREAM log file metadata was corrupted or improperly specified in the T-SQL command.
Step-by-Step Resolution Guide
Step 1: Review the T-SQL Script or Command Causing the Error
- Locate the
CREATE DATABASEorALTER DATABASEstatement responsible for defining the FILESTREAM filegroup. - Check the
SIZEparameter under theFILESTREAMfile specification; ensure it is explicitly set to1MBor higher (e.g.,SIZE = 1MB). - Example of a corrected script snippet:
ALTER DATABASE [YourDB]
ADD FILE (NAME = FileStreamLog, FILENAME = 'C:\SQLData\FileStreamLog')
TO FILEGROUP [FileStreamGroup]
- Confirm no automation tool or PowerShell deployment script is passing a size value of
0or a null parameter.
Step 2: Verify FILESTREAM Configuration in SQL Server Configuration Manager
- Open SQL Server Configuration Manager on Windows Server 2025 / Windows 11.
- Navigate to SQL Server Services > right-click your instance > Properties > FILESTREAM tab.
- Ensure Enable FILESTREAM for Transact-SQL access is checked.
- Confirm the Windows share name is valid and matches the path referenced in your database file structure.
Step 3: Inspect and Repair the Underlying File System Path
- Navigate to the physical FILESTREAM data directory (e.g.,
C:\SQLData\FileStreamLog). - Verify the folder is not read-only, corrupted, or redirected to a network share with insufficient permissions.
- If the directory was manually created, delete it and allow SQL Server to regenerate it automatically during the next
CREATE DATABASEattempt. - Check NTFS permissions to ensure the SQL Server service account has Full Control on the FILESTREAM data path.
Step 4: Recreate the Database Using Correct Size Parameters
- Drop the problematic database (if it is not yet in production) using:
DROP DATABASE [YourDB]
- Rerun the
CREATE DATABASEstatement with the FILESTREAM log size explicitly defined as1MBor greater. - If working with a restore operation, edit the backup metadata script to correct the
SIZEvalue before executingRESTORE DATABASE.
Step 5: Apply the Latest Cumulative Update for SQL Server 2025
- Check Windows Update or the Microsoft Update Catalog for the latest SQL Server 2025 Cumulative Update (CU).
- Install the update, as known FILESTREAM metadata validation bugs are often patched in CU releases.
- Restart the SQL Server service after installation via SQL Server Configuration Manager.
Alternative or Verification Steps
- Run
SELECT * FROM sys.master_files WHERE type_desc = 'FILESTREAM'to confirm the file size and path are correctly registered without errors. - If the issue persists, use SQL Server Management Studio (SSMS) to manually create the database through the GUI, explicitly setting the FILESTREAM log file size field to 1 MB or higher before executing the script.