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

Troubleshooting Guide: SQL Server Error 838 — Asynchronous API Call Timeout

Why This Error Happens

Error 838 occurs when SQL Server’s scheduler detects that an asynchronous API call (often related to disk I/O, storage drivers, or extended events) has not returned within the expected time window, risking a non-yielding scheduler condition. This is typically caused by underlying storage subsystem latency, outdated or corrupted storage/filter drivers, or resource contention from antivirus/filter drivers intercepting I/O calls. It can also result from CPU scheduling starvation on the host (physical or virtual) preventing SQL Server threads from completing their asynchronous operations in time.

Step-by-Step Resolution Guide

Step 1: Check Storage and Disk I/O Health

  • Open Windows Admin Center or Performance Monitor (perfmon.exe) and monitor the Avg. Disk sec/Read and Avg. Disk sec/Write counters on the volumes hosting .mdf/.ldf files.
  • Values consistently above 15-20ms indicate storage latency issues.
  • Review C:\Windows\System32\winevt\Logs\System.evtx for related disk or storahci driver warnings.
  • If using SAN/NAS storage, confirm multipathing (MPIO) drivers are up to date via Get-MPIOSetting in PowerShell.

Step 2: Update Storage and Filter Drivers

  • Navigate to Device Manager > Disk Drives and update storage controller drivers to the latest WHQL-certified version for Windows Server 2025 / Windows 11.
  • Check for third-party filter drivers (antivirus, backup agents) using fltmc.exe in an elevated Command Prompt.
  • Temporarily disable or exclude SQL Server data/log directories (commonly D:\SQLData and E:\SQLLogs) from real-time antivirus scanning.

Step 3: Review SQL Server Configuration and Trace Flags

  • Open SQL Server Configuration Manager and confirm the instance is not oversubscribed on max degree of parallelism relative to available logical CPUs.
  • Check ERRORLOG located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for repeated Error 838 entries and correlate timestamps with I/O spikes.
  • Consider enabling Trace Flag 3614 only under guidance from Microsoft Support to capture additional diagnostic output for async call timeouts.

Step 4: Validate Virtualization/Host Resources (if applicable)

  • If SQL Server runs on a VM (Hyper-V), confirm CPU Reservation and Ready Time metrics on the host are not causing scheduling delays.
  • Use Get-VM | Select Name, CPUUsage, MemoryAssigned in PowerShell on the Hyper-V host to check for resource contention.
  • Ensure Dynamic Memory is disabled for latency-sensitive SQL Server VMs.

Step 5: Apply Latest SQL Server 2025 Cumulative Update

  • Download and install the latest Cumulative Update (CU) from the Microsoft Update Catalog for SQL Server 2025.
  • Run SELECT @@VERSION; in SSMS to confirm the build number matches the latest CU release notes.
  • Restart the SQL Server service via services.msc after installation.

Alternative or Verification Steps

  • Run DBCC CHECKDB and review sys.dm_os_wait_stats for ASYNC_IO_COMPLETION or IO_COMPLETION wait types trending downward after applying fixes.
  • If the error persists after driver and CU updates, open a Microsoft Support case and provide a SQL Server memory dump (.mdmp) generated at the time of the Error 838 event for deep diagnostic analysis.