When installing SQL Server on Windows 11, sometimes it fails!
When installing (or upgrading) SQL Server (2016+) on a machine running Windows 11, you may find that the installation fails with the following SQL Server error:
Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
Even with this error, SQL Server is installed. But it isn’t running! The service won’t start. When you attempt to start the SQL Server service, you get this error:
Windows could not start the SQL Server service on Local Computer. Error 1067: The process terminated unexpectedly.
The installation log files aren’t helpful!
The setup summary file doesn’t tell us much more. This will usually be located somewhere like C:\Program Files\Microsoft SQL Server\[n]\Setup Bootstrap\Log\Summary.txt
|Database Engine Services
|Reason for failure:
|An error occurred during the setup process of the feature.
|Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
|SQL Server Database Engine Services Instance Features
|Component error code:
|Wait on the Database Engine recover handle failed. Check the SQL Server error log for potential causes.
Why is this SQL Server error happening in Windows 11?
It took some googling research and a few wrong turns, but I eventually came across this Microsoft article that documented the problem. Below is the key section for understanding the cause:
On systems running Windows 11, some new storage devices and device drivers will expose a disk sector size greater than the supported 4 KB sector size.
Put simply, the problem is caused by a compatibility issue with your machine’s disk drive. You can confirm this by running the below command from a Windows Command Prompt:
fsutil fsinfo sectorinfo <volume pathname>
If the value of PhysicalBytesPerSectorForAtomicity is greater than 4096, then this is likely the cause of the SQL Server start-up error that you’re experiencing. If it is 4096 (or less), then there’s something else going on for you to investigate.
How do I fix it?
- The registry key solution worked, but only after I then reinstalled SQL Server.
- The trace flag solution didn’t, which was a shame, because I prefer adding trace flags to modifying the Windows Registry!
I hope you found this useful! If you’re interested in talking to us about our database services, then please contact us.