Fix it now
Setup started your new instance and never got a usable handle back. Microsoft’s documented cause for this code is a storage device reporting a physical sector size larger than 4 KB, which SQL Server does not support. Check the sector size before you touch service accounts or directories.
fsutil fsinfo sectorinfo C:
fsutil fsinfo sectorinfo D:
- Read
PhysicalBytesPerSectorForAtomicityandPhysicalBytesPerSectorForPerformance. Take the larger. 4096 or 512 is supported; 8192 or 16384 is the problem. - If a volume reports more than 4096, create a multi-string value named
ForcedPhysicalSectorSizeInBytesunderHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device, set its data to* 4095, and reboot. - If every volume is fine, open the half-built instance’s error log under
<instance directory>\MSSQL\Log\ERRORLOG. Errors 5178 and 5179 also name sector-size problems; anything else is your real cause. - Remove the failed instance through the supported uninstall before retrying, so the next attempt starts clean.
The other spelling matters. 0x851A0019 is “Could not find the Database Engine startup handle”; 0x851A001A is “Wait on the Database Engine recovery handle failed”. If yours is the second one and you were applying a cumulative update rather than installing, this is the wrong article – go to error 912.
If setup completes and the service stays up, you are done. If not, the next section covers what setup is waiting for and what the engine writes while it fails.
Why it happens
The last thing setup does for a database engine instance is start it. Before that instance can accept anything it has to attach and recover master, build tempdb from model, and bring msdb online. Setup holds a handle on that startup and waits. If it never gets the handle, it reports 0x851A0019 and Summary.txt records the description “Could not find the Database Engine startup handle”. If it gets the handle and the wait then fails, it reports 0x851A001A with “Wait on the Database Engine recovery handle failed”. Both codes describe where setup was standing, not what went wrong.
Microsoft documents one concrete cause for both, and it is not the one people look for. Some storage devices and drivers expose a physical sector size larger than the 4 KB SQL Server supports. Windows 10 NVMe drivers emulated 4 KB; newer drivers report the true size, often 8 KB or 16 KB. The engine refuses to use files on such a volume, so a brand-new instance never comes online and setup reports a handle failure. In the error log you get 5179, cannot use the file because it is on a volume with sector size 8192, or 5178, the file was originally formatted with sector size 4096 and is now on a volume with a larger one.
The other documented reading of “Wait on the Database Engine recovery handle failed” is nothing to do with a fresh install at all. Microsoft describes it as what setup reports when the T-SQL upgrade scripts shipped with a cumulative update fail to run, with errors 912 and 3417 in the instance error log. If you are patching rather than installing, that is your path and trace flag 902 is the way in.
Everything else is diagnosis from one file. The engine writes to its own error log throughout the failed attempt and the file survives, in the MSSQL\Log folder under the instance directory you chose. It records the account the service ran as, the collation it was given, each system database it tried to open, and where it stopped.
A volume reports a sector size larger than 4 KB
You have this one if fsutil fsinfo sectorinfo returns 8192 or 16384, and the error log shows 5178 or 5179 naming master.mdf. Very common on recent NVMe hardware and on some Azure virtual machines.
- Add the multi-string value
ForcedPhysicalSectorSizeInByteswith data* 4095underHKLM\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device, then reboot. This makes the driver emulate a 4 KB sector. - Or, if the machine has several drives, install to a volume that already reports a supported sector size and point the database files there.
- Re-run
fsutil fsinfo sectorinfoafter the reboot and confirm the reported value before retrying setup.
The same fault produces other symptoms on an instance that is already running: misaligned log I/O warnings, and in some cases sqlservr.exe faulting outright. It is worth checking on any server that has had its storage or its drivers changed.
The media is damaged
You have this one if Summary.txt names the startup handle, and elsewhere in the logs there is a corrupt cabinet, an unreadable file, or setup error 2337.
- Copy the whole ISO to a local folder and install from there rather than from a mounted image or a share.
- If it fails at the same file from a verified local copy, download the media again from the original location.
- Check Summary.txt for the underlying error before assuming the engine itself is at fault.
Microsoft lists damaged or corrupted installation media as a documented cause of the startup handle failure, alongside the sector-size problem.
The service account cannot start or cannot reach its folders
You have this one if The error log shows an access-denied opening master, or barely writes anything before the service exits.
- Retry with the default per-service accounts, which setup provisions itself.
- If a domain account is required, give it the Log on as a service right on that machine and rights on the data, log and backup folders before running setup.
- Watch the instance error log as it starts, rather than reading Summary.txt afterwards.
A data, log or tempdb path is unusable
You have this one if Setup succeeds with default directories and fails as soon as you point them elsewhere, or the error log names a path.
- Confirm every path you gave setup exists on local storage, has free space, and is not a mapped drive, a UNC path or removable media.
- Keep tempdb on local storage. The engine recreates it at every startup and will not proceed if it cannot.
- Install with default directories to prove the point, then relocate the files afterwards with ALTER DATABASE and a planned restart.
Files from a previous install are in the target folder
You have this one if This is a reinstall after a failed or badly removed instance, and the target data folder already contains system database files.
- Remove the failed instance through the supported uninstall route first, rather than installing over it.
- Move any leftover system database files to a holding directory. Copy rather than delete until the new instance is up.
- Rerun setup and let it create fresh system databases.
Never move or delete files belonging to another instance on the same machine. Confirm which instance owns a folder before touching anything in it.
Full reference
Telling the two codes apart
| Code | Description setup records | Where it usually comes from |
|---|---|---|
0x851A0019 |
Could not find the Database Engine startup handle | A new install where the engine never came online |
0x851A001A |
Wait on the Database Engine recovery handle failed | A new install that got further, or a cumulative update whose upgrade scripts failed |
That distinction is worth getting right because it changes where you look. A startup handle that was never found means the engine did not reach a state setup could observe, so the sector size, the media and the service account are in scope. A recovery handle wait that failed after a patch means the binaries are new, the scripts ran, and one of them broke – which is a completely different repair.
Checking sector size properly
fsutil fsinfo sectorinfo C:
fsutil fsinfo sectorinfo E:
Read PhysicalBytesPerSectorForAtomicity and PhysicalBytesPerSectorForPerformance and keep the larger of the two. SQL Server supports 512 bytes and 4 KB. Anything above that has to be emulated down with the ForcedPhysicalSectorSizeInBytes registry value, or avoided by putting the database files on a volume that reports a supported size.
| Setting | Value |
|---|---|
| Key | HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device |
| Value name | ForcedPhysicalSectorSizeInBytes |
| Type | Multi-String |
| Data | * 4095 |
| Takes effect | After a reboot |
Where to look, in order
| Place | What it gives you |
|---|---|
Summary.txt in the Setup Bootstrap Log folder |
The component error code and its description |
<instance directory>\MSSQL\Log\ERRORLOG |
The engine’s own account of why it would not start |
Detail.txt in the newest timestamped folder |
The point at which setup stopped |
fsutil fsinfo sectorinfo |
Whether the volume is one the engine can use at all |
| Windows Application log | Service control manager entries for a service that would not start |
net start MSSQL$<instance> |
Starts the service by hand and returns the error directly |
Errors 5178 and 5179 in the instance error log
- 5179 reads “Cannot use file … because it is on a volume with sector size 8192. SQL Server supports a maximum sector size of 4096 bytes.”
- 5178 reads “Cannot use file … because it was originally formatted with sector size 4096 and is now on a volume with sector size 8192.” This is the one you get after moving files, or after a driver update changed what the volume reports.
- Either message means the sector size, not the account and not the path. Fix the volume and the install proceeds without any other change.
If you are actually patching, not installing
Setup reporting “Wait on the Database Engine recovery handle failed” while applying a cumulative update or service pack is the documented signature of an upgrade-script failure. Look for errors 912 and 3417 in the newest instance error log. The messages immediately before 912 name the real problem, and the route in is starting the service with trace flag 902 so you can fix it and let the scripts complete. None of the install-time advice on this page applies to that case.
Before you retry
- Remove the failed instance through the supported uninstall. Installing over a partially built instance produces a second, more confusing failure.
- Move leftover system database files out of the target folder rather than deleting them.
- If you are in a hurry, a different instance directory sidesteps residue entirely.
- Run setup elevated as a genuine local administrator; Microsoft states this as a prerequisite for local installations.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
0x851A0019 |
Setup could not find the Database Engine startup handle: the new instance never reached a state setup could observe | Microsoft Learn |
0x851A001A |
Wait on the Database Engine recovery handle failed: setup got the handle and the wait then failed, which is also what a failed upgrade script reports | Microsoft Learn |
0x80070005 |
The HRESULT form of system error 5, ERROR_ACCESS_DENIED: access is denied | Microsoft Learn |
Confirm the fix worked
fsutil fsinfo sectorinforeports 4096 or less for every volume the instance uses.- The service starts from SQL Server Configuration Manager and stays running.
- The instance error log shows recovery completing for the system databases, followed by the ready for connections entry, and no 5178 or 5179.
SELECT @@VERSION;andSELECT SERVERPROPERTY('Collation');return from a new connection.- Reboot the machine and confirm the service starts on its own.
Questions people ask about this
Is my data at risk?
On a new install there is nothing to lose. If this appeared during an upgrade of an existing instance, your databases are still on disk and untouched; the engine never reached a ready state, so nothing was modified.
Why would a brand-new server hit a sector size problem?
Because the driver changed, not the disk. Newer NVMe drivers report the device’s true physical sector size where older ones emulated 4 KB. SQL Server supports 512 bytes and 4 KB only, so a machine that would have installed fine a year ago now fails at the point the engine tries to open master.
Does this cost anything to fix?
No. Every fix here is configuration: a driver setting, folder rights, directory choices, or getting the media again. Your licence is not involved and setup usually never reached the point of using a key.
Should I remove the failed instance before retrying?
Yes. Installing over a partially built instance is a reliable way to produce a second, more confusing failure. Remove it properly, clear leftover files, then start again.
Can I make setup wait longer?
The wait is rarely the problem; the engine failing is. If the instance genuinely is slow rather than broken, the error log shows recovery progressing rather than failing, and the answer is faster storage rather than a longer timeout.
