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

Troubleshooting Guide: SQL Server Error 1490 – FILESTREAM Log Backup Restoration Failure

Why This Error Happens

Error 1490 occurs when SQL Server attempts to bring a database online during a mirroring or Always On Availability Group failover, but the FILESTREAM data on the secondary/remote replica is not synchronized with the FILESTREAM data on the primary. This typically happens because a log backup containing the required FILESTREAM garbage collection or file operations was never restored to the secondary, leaving the filegroup in an inconsistent state. It can also occur after an improper failback sequence where FILESTREAM container files were manually modified or deleted outside of SQL Server’s control.

Step-by-Step Resolution Guide

Step 1: Verify FILESTREAM Configuration Consistency

  • Open SQL Server Configuration Manager on both the primary and secondary nodes and confirm FILESTREAM access is enabled at the service level.
  • Check sys.database_filestream_options on both instances to ensure the directory_name and non_transacted_access settings match exactly.
  • Run SELECT * FROM sys.dm_io_cluster_shared_volumes (if using S2D/Clustered Storage) to confirm the storage path is reachable from the secondary node.

Step 2: Take a Fresh Log Backup and Restore Chain

  • On the primary replica, force a full log backup that captures the FILESTREAM transaction boundary:
  • BACKUP LOG [YourDatabaseName] TO DISK = 'C:\SQLBackups\YourDB_Log.trn'
  • Copy this backup file to the secondary server’s accessible backup path (e.g., D:\SQLBackups\).
  • Restore the log backup on the secondary instance in NORECOVERY mode:
  • RESTORE LOG [YourDatabaseName] FROM DISK = 'D:\SQLBackups\YourDB_Log.trn' WITH NORECOVERY

Step 3: Re-synchronize the FILESTREAM Filegroup

  • If the restore chain is broken, remove the existing secondary database and FILESTREAM container folder from the replica (e.g., D:\SQLData\FileStreamData\).
  • Perform a fresh Full Backup on the primary including FILESTREAM data, then restore it on the secondary with NORECOVERY before reapplying the log chain.
  • Validate the FILESTREAM container GUID matches between primary and secondary using SELECT file_id, physical_name FROM sys.database_files WHERE type_desc = 'FILESTREAM'.

Step 4: Rebuild the Availability Group or Mirroring Session

  • If the error persists after resynchronization, remove the database from the Availability Group: ALTER AVAILABILITY GROUP [AGName] REMOVE DATABASE [YourDatabaseName].
  • Re-join the database to the AG, forcing a full re-seed via automatic seeding or manual backup/restore, ensuring the FILESTREAM share permissions (Windows ACLs) are identical on both nodes.

Alternative or Verification Steps

  • To verify the fix, query sys.dm_hadr_database_replica_states and confirm synchronization_state_desc returns SYNCHRONIZED and is_suspended is 0.
  • If the issue persists, check the Windows Security Event Log for Access Denied errors on the FILESTREAM share path, as NTFS permission mismatches between the SQL Server service accounts on the primary and secondary nodes are a common alternative root cause.