Troubleshooting Guide: SQL Server Error 5142 – Failed to Lock Lease Renewal Manager
Why This Error Happens
Error 5142 occurs when SQL Server’s internal Lease Renewal Manager—a component responsible for maintaining cluster or Availability Group health signaling—cannot acquire the required lock (Shared or Exclusive) within the expected timeframe. This typically happens due to resource contention from a high volume of concurrent lease renewal threads, latch starvation caused by CPU scheduling pressure, or a stalled I/O subsystem preventing the lease state from being updated. In clustered or Always On configurations, this can also stem from the lease renewal thread being blocked by another process holding the lock for an abnormally long duration.
Step-by-Step Resolution Guide
Step 1: Verify Cluster and SQL Server Service Health
- Open Failover Cluster Manager and confirm the SQL Server resource group is online and not in a “Failed” or “Pending” state.
- Check the Windows Event Viewer under Applications and Services Logs > Microsoft > Windows > FailoverClustering for correlating lease timeout warnings.
- Run
Get-ClusterResource | Format-List *in PowerShell (elevated) to inspect resource status and LastTransitionTime.
Step 2: Check for CPU and I/O Resource Starvation
- Open Performance Monitor (PerfMon) and review counters for
SQLServer:Wait StatisticsandProcessor: % Processor Time. - Identify if
PAGEIOLATCHorTHREADPOOLwait types are elevated, indicating the lease renewal thread is being starved. - If running on a VM, confirm host-level CPU ready time isn’t excessive using Hyper-V Manager or VMware performance tabs.
Step 3: Increase Lease Timeout Threshold (If Applicable)
- Navigate to SQL Server Configuration Manager > SQL Server Services.
- Right-click the SQL Server (MSSQLSERVER) instance, go to Properties > Startup Parameters.
- Review Always On Availability Group lease timeout settings via:
ALTER AVAILABILITY GROUP [YourAGName] SET (LEASE_TIMEOUT = 40);
- Restart the SQL Server service for changes to take effect:
Restart-Service MSSQLSERVER.
Step 4: Repair Corrupted System Files or SQL Binaries
- Run
sfc /scannowin an elevated Command Prompt on Windows Server 2025 to rule out OS-level file corruption affecting SQL Server’s lease threads. - If corruption is suspected in SQL binaries, repair the instance via Control Panel > Programs > Microsoft SQL Server 2025 > Uninstall/Change > Repair.
Step 5: Review and Clear Blocking Processes
- Query active locks using:
SELECT * FROM sys.dm_tran_locks WHERE resource_type = 'DATABASE';
- Identify any long-running transaction holding locks that may be delaying the lease renewal manager and terminate it with
KILL [session_id]if safe to do so.
Alternative or Verification Steps
- After applying fixes, monitor the SQL Server Error Log (
ERRORLOGfile located inC:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\LOG\) for 24–48 hours to confirm Error 5142 does not recur. - If the issue persists, failover the Availability Group to a secondary replica (
ALTER AVAILABILITY GROUP [YourAGName] FAILOVER;) to isolate whether the problem is node-specific or shared across the cluster.