Wait on the Database Engine recovery handle failed. Check the SQL server error log for potential causes

121,095

Solution 1

Below worked for me:

When you come to Server Configuration Screen, Change the Account Name of Database Engine Service to NT AUTHORITY\NETWORK SERVICE and continue installation and it will successfully install all components without any error. - See more at: https://superpctricks.com/sql-install-error-database-engine-recovery-handle-failed/

Solution 2

In my case, setting SQL Server Database Engine service startup account to NT AUTHORITY\NETWORK SERVICE failed, but setting it to NT Authority\System allowed me to succesfully install my SQL Server 2016 STD instance.

Just check the following snapshot.

enter image description here

For further details, check @Shanky's answer at https://dba.stackexchange.com/a/71798/66179

Remember: you can avoid server rebooting using setup's SkipRules switch:

setup.exe /ACTION=INSTALL /SkipRules=RebootRequiredCheck

setup.exe /ACTION=UNINSTALL /SkipRules=RebootRequiredCheck

Solution 3

Simple Steps

  1. 1 Open SQL Server Configuration Manager
  2. Under SQL Server Services Select Your Server
  3. Right Click and Select Properties
  4. Log on Tab Change Built-in-account tick
  5. in the drop down list select Network Service
  6. Apply and start The service

Solution 4

This post is high up when you google that error message, which I got when installing security patch KB4505224 on SQL Server 2017 Express i.e. None of the above worked for me, but did consume several hours trying.

The solution for me, partly from here was:

  1. uninstall SQL Server
  2. in Regional Settings / Management / System Locale, "Beta: UTF-8 support" should be OFF
  3. re-install SQL Server
  4. Let Windows install the patch.

And all was well.

More on this here.

Solution 5

Root cause: Corrupted user profile of user account used to start database

The main thread here seems to be a corrupted user account profile for the account that is used to start the DB engine. This is the account that was specified for the "SQL Server Database" engine during installation. In the setup event log, it's also indicated by the following entry:

SQLSVCACCOUNT:                 NT AUTHORITY\SYSTEM

According to the link provided by @royki:

The root cause of this issue, in most cases, is that the profile of the user being used for the service account (in my case it was local system) is corrupted.

This would explain why other respondents had success after changing to different accounts:

  • bmjjr suggests changing to "NT AUTHORITY\NETWORK SERVICE"
  • comments to @bmjjr indicate different accounts "I used NT AUTHORITY\LOCAL SERVICE. That helped too"
  • @Julio Nobre had success with "NT Authority\System "

Fix: reset the corrupt user profile

To fix the user profile that's causing the error, follow the steps listed KB947215.

The main steps from KB947215 are summarized as follows:-

  1. Open regedit
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
  3. Navigate to the SID for the corrupted profile

    To find the SID, click on each SID GUID, review the value for the ProfileImagePath value, and see if it's the correct account. For system accounts, there's a different way to know the SID for the account that failed:

The main system account SIDs of interest are:

SID          Name               Also Known As
S-1-5-18     Local System       NT AUTHORITY\SYSTEM
S-1-5-19     LocalService       NT AUTHORITY\LOCAL SERVICE
S-1-5-20     NetworkService     NT AUTHORITY\NETWORK SERVICE

For information on additional SIDs, see Well-known security identifiers in Windows operating systems.

  1. If there are two entries (e.g. with a .bak) at the end for the SID in question, or the SID in question ends in .bak, ensure to follow carefully the steps in the KB947215 article.
  2. Reset the values for RefCount and State to be 0.
  3. Reboot.
  4. Retry the SQL Server installation.
Share:
121,095
royki
Author by

royki

Updated on July 30, 2020

Comments

  • royki
    royki almost 4 years

    I m using SQL Server 2012 Developer Edition. Even I tried 2012 express and enterprise edition but all gave same error. I browsed msdn blog as well as few post on stackoverflow. But nothing help me out from this !!!

    Error Details

    Installation failed

    Here is the error log details

    Overall summary:
    Final result:                  Failed: see details below
    Exit code (Decimal):           -2061893606
    Start time:                    2013-10-21 12:58:05
    End time:                      2013-10-21 13:52:30
    Requested action:              Install
    
    Setup completed with required actions for features.
    Troubleshooting information for those features:
    Next step for RS:              Use the following information to resolve the error,  uninstall this feature, and then run the setup process again.
    Next step for SQLEngine:       Use the following information to resolve the error,  uninstall this feature, and then run the setup process again.
    Next step for DQ:              Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
    Next step for FullText:        Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
    Next step for Replication:     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
    
    
    Machine Properties:
      Machine name:                  CROY-TOSH
      Machine processor count:       4
      OS version:                    Windows 7
      OS service pack:               Service Pack 1
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x64
      Process architecture:          64 Bit
      OS clustered:                  No
    
    Product features discovered:
      Product              Instance             Instance ID                    Feature                                       Language             Edition              Version         Clustered 
    
     Package properties:
       Description:                   Microsoft SQL Server 2012 Service Pack 1
       ProductName:                   SQL Server 2012
       Type:                          RTM
       Version:                       11
       SPLevel:                       0
       Installation location:         C:\Users\CRoy\Downloads\SQL Server 2012 Developer  Edition (x86 and x64) - DVD (English)\x64\setup\
       Installation edition:          Developer
    
     Product Update Status:
      None discovered.
    
    User Input Settings:
     ACTION:                        Install
     ADDCURRENTUSERASSQLADMIN:      false
     AGTSVCACCOUNT:                 NT Service\SQLSERVERAGENT
     AGTSVCPASSWORD:                *****
     AGTSVCSTARTUPTYPE:             Manual
     ASBACKUPDIR:                   C:\Program Files\Microsoft SQL     Server\MSAS11.MSSQLSERVER\OLAP\Backup
     ASCOLLATION:                   Latin1_General_CI_AI
     ASCONFIGDIR:                   C:\Program Files\Microsoft SQL     Server\MSAS11.MSSQLSERVER\OLAP\Config
     ASDATADIR:                     C:\Program Files\Microsoft SQL  Server\MSAS11.MSSQLSERVER\OLAP\Data
     ASLOGDIR:                      C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Log
    ASPROVIDERMSOLAP:              1
    ASSERVERMODE:                  MULTIDIMENSIONAL
    ASSVCACCOUNT:                  NT Service\MSSQLServerOLAPService
    ASSVCPASSWORD:                 <empty>
    ASSVCSTARTUPTYPE:              Automatic
    ASSYSADMINACCOUNTS:            CRoy-TOSH\CRoy
    ASTEMPDIR:                     C:\Program Files\Microsoft SQL   Server\MSAS11.MSSQLSERVER\OLAP\Temp
    BROWSERSVCSTARTUPTYPE:         Disabled
    CLTCTLRNAME:                   ROY
    CLTRESULTDIR:                  C:\Program Files (x86)\Microsoft SQL  Server\DReplayClient\ResultDir\
    CLTSTARTUPTYPE:                Manual
    CLTSVCACCOUNT:                 NT Service\SQL Server Distributed Replay Client
    CLTSVCPASSWORD:                <empty>
    CLTWORKINGDIR:                 C:\Program Files (x86)\Microsoft SQL Server\DReplayClient\WorkingDir\
    COMMFABRICENCRYPTION:          0
    COMMFABRICNETWORKLEVEL:        0
    COMMFABRICPORT:                0
    CONFIGURATIONFILE:             C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131021_125116\ConfigurationFile.ini
    CTLRSTARTUPTYPE:               Manual
    CTLRSVCACCOUNT:                NT Service\SQL Server Distributed Replay Controller
    CTLRSVCPASSWORD:               <empty>
    CTLRUSERS:                     CRoy-TOSH\CRoy
    ENABLERANU:                    false
    ENU:                           true
    ERRORREPORTING:                true
    FEATURES:                      SQLENGINE, REPLICATION, FULLTEXT, DQ, AS, RS, RS_SHP,  RS_SHPWFE, DQC, BIDS, CONN, IS, BC, SDK, BOL, SSMS, ADV_SSMS, DREPLAY_CTLR, DREPLAY_CLT,  SNAC_SDK, MDS
    FILESTREAMLEVEL:               2
    FILESTREAMSHARENAME:           MSSQLSERVER
    FTSVCACCOUNT:                  NT Service\MSSQLFDLauncher
    FTSVCPASSWORD:                 <empty>
    HELP:                          false
    IACCEPTSQLSERVERLICENSETERMS:  false
    INDICATEPROGRESS:              false
    INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
    INSTALLSHAREDWOWDIR:           C:\Program Files (x86)\Microsoft SQL Server\
    INSTALLSQLDATADIR:             <empty>
    INSTANCEDIR:                   C:\Program Files\Microsoft SQL Server\
    INSTANCEID:                    MSSQLSERVER
    INSTANCENAME:                  MSSQLSERVER
    ISSVCACCOUNT:                  NT Service\MsDtsServer110
    ISSVCPASSWORD:                 <empty>
    ISSVCSTARTUPTYPE:              Automatic
    MATRIXCMBRICKCOMMPORT:         0
    MATRIXCMSERVERNAME:            <empty>
    MATRIXNAME:                    <empty>
    NPENABLED:                     0
    PID:                           *****
    QUIET:                         false
    QUIETSIMPLE:                   false
    ROLE:                          <empty>
    RSINSTALLMODE:                 DefaultNativeMode
    RSSHPINSTALLMODE:              SharePointFilesOnlyMode
    RSSVCACCOUNT:                  NT Service\ReportServer
    RSSVCPASSWORD:                 <empty>
    RSSVCSTARTUPTYPE:              Automatic
    SAPWD:                         *****
    SECURITYMODE:                  SQL
    SQLBACKUPDIR:                  <empty>
    SQLCOLLATION:                  Latin1_General_CI_AI
    SQLSVCACCOUNT:                 NT Service\MSSQLSERVER
     SQLSVCPASSWORD:                *****
     SQLSVCSTARTUPTYPE:             Automatic
     SQLSYSADMINACCOUNTS:           CRoy-TOSH\CRoy
     SQLTEMPDBDIR:                  <empty>
     SQLTEMPDBLOGDIR:               <empty>
     SQLUSERDBDIR:                  <empty>
     SQLUSERDBLOGDIR:               <empty>
     SQMREPORTING:                  false
     TCPENABLED:                    0
     UIMODE:                        Normal
     UpdateEnabled:                 true
     UpdateSource:                  MU
     X86:                           false
    
     Configuration file:            C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131021_125116\ConfigurationFile.ini
    
    Detailed results:
    Feature:                       Management Tools - Complete
    Status:                        Passed
    
    Feature:                       Client Tools Connectivity
    Status:                        Passed
    
     Feature:                       Client Tools SDK
     Status:                        Passed
    
    Feature:                       Client Tools Backwards Compatibility
    Status:                        Passed
    
    Feature:                       Management Tools - Basic
    Status:                        Passed
    
    Feature:                       SQL Server Data Tools
    Status:                        Passed
    
    Feature:                       Reporting Services - Native
    Status:                        Failed: see logs for details
    Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
    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 recovery handle failed. Check the SQL Server error log for potential causes.
     Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
    
     Feature:                       Database Engine Services
     Status:                        Failed: see logs for details
      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 recovery handle failed. Check the SQL Server error log for potential causes.
     Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
    
     Feature:                       Data Quality Services
     Status:                        Failed: see logs for details
     Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
     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 recovery handle failed. Check the SQL Server error log for potential causes.
     Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
    
     Feature:                       Full-Text and Semantic Extractions for Search
     Status:                        Failed: see logs for details
     Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      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 recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
    
     Feature:                       SQL Server Replication
     Status:                        Failed: see logs for details
     Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
     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 recovery handle failed. Check the SQL Server error log for potential causes.
     Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
    
     Feature:                       Master Data Services
     Status:                        Passed
    
     Feature:                       Distributed Replay Client
     Status:                        Passed
    
      Feature:                       Distributed Replay Controller
      Status:                        Passed
    
     Feature:                       Integration Services
     Status:                        Passed
    
     Feature:                       Data Quality Client
     Status:                        Passed
    
     Feature:                       Analysis Services
     Status:                        Passed
    
     Feature:                       Reporting Services - SharePoint
     Status:                        Passed
    
     Feature:                       Reporting Services Add-in for SharePoint Products
     Status:                        Passed
    
     Feature:                       SQL Browser
     Status:                        Passed
    
     Feature:                       Documentation Components
     Status:                        Passed
    
     Feature:                       SQL Writer
     Status:                        Passed
    
     Feature:                       SQL Client Connectivity
     Status:                        Passed
    
     Feature:                       SQL Client Connectivity SDK
     Status:                        Passed
    
     Rules with failures:
    
     Global rules:
    
     Scenario specific rules:
    
     Rules report file:               C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131021_125116\SystemConfigurationCheck_Report.htm
    

    Here is few links

    Blog MSDN

    StackOverflow1

    StackOverflow2

  • Csaba Toth
    Csaba Toth about 9 years
    I used NT AUTHORITY\LOCAL SERVICE. That helped too.
  • Nathan McKaskle
    Nathan McKaskle over 8 years
    Do I have to uninstall the whole damn thing again and reinstall it all over again? It won't let me just reinstall.
  • Banketeshvar Narayan
    Banketeshvar Narayan over 8 years
    I used NT AUTHORITY\NETWORK SERVICE and issue resolved.
  • Omer
    Omer over 7 years
    This one worked for me too NT AUTHORITY\LOCAL SERVICE. Really I great solution, I spent a lot but didn't get anything useful from microsoft as usual.
  • Ali Rasoulian
    Ali Rasoulian over 7 years
    I've reinstalled, NT AUTHORITY\NETWORK SERVICE worked for me.
  • Carl Prothman
    Carl Prothman over 7 years
    I ran into the same thing installing SQL Server 2016. I need to set the Database Engine Service to NT AUTHORITY\NETWORK SERVICE.
  • oscar
    oscar over 6 years
    @NathanMcKaskle No need to reinstall, just run "services.msc", locate SqlServer service, double click and select local account.
  • Archlight
    Archlight over 4 years
    It was enough for me repair the installation and kept therefore all databases and settings that I already had. This setting is pretty well hidden: Control panel\Clock and Region\Region\Adminstrative tab\Change system locale button \Region Settings
  • Steven J
    Steven J about 4 years
    Awesome, you saved me. Was looking other solutions with User accounts. Would have never think about this. Indeed seems to be link to last build windows 1903
  • Alfred Roa
    Alfred Roa over 2 years
    I ran into the same thing. Used AUTHORITY\NETWORK SERVICE but issue was not resolved. I'm using sql 2017 express and Windows 11 OS.
  • Juan Pablo Gomez
    Juan Pablo Gomez about 2 years
    Just the answer I was expecting after 4 hour