Troubleshooting Guide: SQL Server Error 9602 – “Failed to start a system task with error code %d”
Why This Error Happens
This error typically occurs when SQL Server’s internal scheduler is unable to allocate a worker thread for a background system task, often due to resource exhaustion or a misconfigured max worker threads setting. It can also result from insufficient memory reserved for the SQLOS scheduler pool, corrupted system database files (such as tempdb or model), or a Windows-level permission restriction preventing the SQL Server service account from spawning new threads. In some cases, this is triggered by antivirus or endpoint protection software interfering with SQL Server’s process-level thread creation on Windows Server 2025 / Windows 11.
Step-by-Step Resolution Guide
Step 1: Verify SQL Server Service Account Permissions
- Open Services.msc and locate the SQL Server (MSSQLSERVER) service.
- Confirm the service account has “Log on as a service” rights under
Local Security Policy > User Rights Assignment. - Ensure the account is not restricted by Group Policy on Windows Server 2025 domain controllers.
- Restart the SQL Server service after confirming permissions.
Step 2: Check and Adjust Max Worker Threads Configuration
- Open SQL Server Management Studio (SSMS) and run:
EXEC sp_configure 'max worker threads';
- If the value is non-zero and too low for your workload, reset it to default (0 = auto-configure) using:
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'max worker threads', 0;
RECONFIGURE;
- Restart the SQL Server instance for changes to take effect.
Step 3: Rebuild or Repair TempDB
- Check the health of
tempdbfiles located atC:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\. - Stop the SQL Server service, verify the drive has sufficient free space (minimum 20% recommended), and restart the service.
- If corruption is suspected, run:
DBCC CHECKDB (tempdb) WITH NO_INFOMSGS;
Step 4: Exclude SQL Server Processes from Antivirus/EDR Scanning
- Add exclusions for
sqlservr.exeand the data/log directories in Windows Defender or third-party antivirus software. - Navigate to
Windows Security > Virus & threat protection > Exclusionsand add the SQL Server installation path. - Restart the SQL Server service and monitor the SQL Server Error Log for recurrence of Error 9602.
Alternative or Verification Steps
- Check the SQL Server Error Log (
ERRORLOGfile in theMSSQL\LOGdirectory) after restarting the service to confirm Error 9602 no longer appears during startup or task execution. - If the issue persists, run
sp_configure 'max worker threads'again to confirm the value reset correctly, and review Windows Event Viewer > System Log for related resource-exhaustion warnings (e.g., thread pool starvation or memory pressure alerts).