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
|Feature:||Database Engine Services|
|Reason for failure:||An error occurred during the setup process of the feature.|
|Next step:||Use the following information to resolve the error, uninstall this feature, and then run the setup process again.|
|Component name:||SQL Server Database Engine Services Instance Features|
|Component error code:||0x851A001A|
|Error description:||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 possible solutions are also documented in the same Microsoft article. I won’t repeat them, but here’s what I found when fixing the issue on my machine:
- 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!