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

Troubleshooting Guide: SQL Server Error 13104 (RANGE)

Why This Error Happens

Error 13104 typically occurs when SQL Server 2025’s internal availability group or replication engine encounters an invalid or out-of-bounds RANGE value while parsing log blocks or metadata structures during data synchronization. This is commonly triggered by corrupted transaction log records, mismatched endpoint configurations between replicas, or incompatible service pack/build versions across nodes in a Windows Server 2025 cluster. In some cases, insufficient permissions on the SQL Server service account can prevent proper validation of the RANGE parameter during log shipping or Always On Availability Group communication.

Step-by-Step Resolution Guide

Step 1: Verify SQL Server Service Account Permissions

  • Open Services.msc on Windows Server 2025 and confirm the SQL Server service is running under a domain account with appropriate permissions.
  • Ensure the account has db_owner rights on the affected database and is part of the sysadmin fixed server role if required for replication tasks.
  • Run the following T-SQL to check current permissions:
  SELECT * FROM sys.server_role_members WHERE role_principal_id = SUSER_ID('sysadmin');

Step 2: Check and Repair Transaction Log Integrity

  • Open SQL Server Management Studio (SSMS) and run a consistency check on the affected database.
  • Execute the following command to identify corruption:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is found, run:
  DBCC CHECKDB ('YourDatabaseName') WITH REPAIR_ALLOW_DATA_LOSS;
  • Back up the database immediately after repair using BACKUP DATABASE.

Step 3: Validate Availability Group Endpoint Configuration

  • Navigate to SQL Server Configuration Manager > SQL Server Network Configuration > Protocols.
  • Confirm the endpoint URL and port (default 5022) match across all replica nodes in sys.availability_group_listener_ip_addresses.
  • Run this query on each replica to compare RANGE boundaries in log sequence numbers (LSNs):
  SELECT * FROM sys.dm_hadr_database_replica_states;
  • Restart the SQL Server Always On Availability Groups service if mismatches are found.

Step 4: Update SQL Server 2025 to the Latest Cumulative Update

  • Go to Microsoft Update Catalog and download the latest Cumulative Update (CU) for SQL Server 2025.
  • Install the update on all nodes in the cluster to ensure version parity.
  • Reboot the Windows Server 2025 instance after installation via shutdown /r /t 0.

Alternative or Verification Steps

  • Verify the fix by re-running the failed operation (log shipping, replication sync, or backup job) and confirming Error 13104 no longer appears in the SQL Server Error Log (Management > SQL Server Logs in SSMS).
  • If the issue persists, restore the database from a known-good backup and rebuild the Always On Availability Group from scratch using ALTER AVAILABILITY GROUP ... JOIN.