Troubleshoot common SQL Server Cumulative Update installation issues
This article provides general steps to troubleshoot issues that you might experience when you apply a Cumulative Update (CU) or Service Pack (SP) to your Microsoft SQL Server instance. It also provides information on how to resolve the following error messages or conditions:
Wait on Database Engine recovery handle failed
message and errors 912 and 3417 when you run upgrade scripts.- Setup errors that occur because of missing MSI or MSP (update) files in the Windows Installer cache.
The Database Engine system data directory in the registry is not valid
orthe User Log directory in the registry is not valid
messages.Network path was not found
and other error messages that you receive if Remote Registry Service or admin shares are disabled on an Always On Failover Cluster instance (FCI) or Always On Availability Groups.
Cumulative update and service pack installation information
This section provides information about CU and SP installations.
For Microsoft SQL Server 2016 and earlier versions:
- Before you install a CU, make sure that your SQL Server instance is at the right SP level for that CU. For example, you can't apply CU17 for SQL 2016 SP2 before you apply SP2 for the SQL Server 2016 instance.
- You can always apply the latest CU for a given SP baseline without having to apply previous CUs for that service pack. For example, to apply CU17 for SQL Server 2016 SP2 instance, you can skip applying previous updates to CU14, CU15, and CU16, if they aren't installed, and apply CU17 directly.
For Microsoft SQL Server 2017 and later versions, you can always apply the latest CU that's available. (No service packs exist for SQL Server 2017 and later versions.)
Before you apply a CU or SP, make sure that the instance that you're updating is correctly installed. The SQL Server program files and data files can't be installed on:
- A removable disk drive.
- A file system that uses compression.
- A directory in which system files are located.
- Shared drives on a failover cluster instance.
If you add a database engine feature after you apply a CU or an SP to an instance, you should update the new feature to the same level as the program instance before you apply any new CUs or SPs.
General troubleshooting methodology
Isolate the error by following these steps:
- Select Details from the setup process's Failure screen.
- In the %programfiles%\Microsoft SQL Server\nnn\Setup Bootstrap\Log folder, check Summary.txt under the Product features discovered section to determine whether any of the listed features report a failure. If they do, you can focus on resolving problems that affect that feature.
- Go to the subfolder that's named yyyyMMdd_HHmmss (for example 20220618_174947) that corresponds to the reported failure time that you are focusing on. The goal is to examine the feature-specific files, ERRORLOG files, and Details.txt file, if necessary.
- Go to the \MSSQLSERVER subfolder, and locate the log files that are specific to the feature that failed. For example, sql_engine_core_inst_Cpu64_1.log. For upgrade script failures, check the SQLServer_ERRORLOG_date_time.txt files that correspond to the time of the upgrade failure.
- Open the Details.txt log file, and search on the keyword "Failed." Not every failure is considered critical.
For more information, see View and Read SQL Server Setup Log Files.
In the next few sections, check for a scenario that corresponds to your situation, and then follow the associated troubleshooting steps. If there's no matching scenario, look for more pointers in the log files.
Errors 912 and 3417 and "Wait on Database Engine recovery handle failed"
T-SQL upgrade scripts are shipped together with every SQL Server cumulative update. They're run after the SQL Server binaries are replaced with the latest versions. If these T-SQL scripts don't run for some reason, the Setup program reports a "Wait on Database Engine recovery handle failed" error. Setup records errors 912 and 3417 in the latest SQL Server error log. Errors 912 and 3417 are associated with database script upgrade failures and failure to recover the master
database, respectively. The messages that precede error 912 usually provide information about the root cause of the failure that occurred when the upgrade scripts were run.
There could be a variety of errors raised together with 912 and 3417. For more information about a summary of common scenarios and related solutions, see Troubleshoot upgrade script failures when applying an update.
Setup errors caused by missing installer files in Windows cache
Applications such as SQL Server that use Windows Installer technology for the setup process will store critical files in the Windows Installer cache. The default installer cache location is C:\Windows\Installer. These files are required for uninstalling and updating applications. They're unique to that computer. Updates to applications that depend on these files won't work if they're accidentally deleted or otherwise compromised. To resolve this condition, use one of the following methods that are described in Restore the missing Windows Installer cache files:
- Repair the SQL Server installation.
- Use the FixMissingMSI tool.
- Use the FindSQLInstalls.vbs script.
- Manually restore the files.
- Restore files from the system state backups.
- Review and implement the procedures that are described in Restore the missing Windows Installer cache files.
Setup fails because of incorrect data or log location in registry
When you install a CU or SP, if the default data and log folders are invalid, you may receive errors that resemble the following messages:
"The User Data directory in the registry is not valid. Verify DefaultData key under the instance hive points to a valid directory."
"The User Log directory in the registry is not valid. Verify DefaultLog key under the instance hive points to a valid directory."
"Error installing SQL Server Database Engine Services Instance Features. The Database Engine system data directory in the registry is not valid."
To fix this issue, follow these steps:
- Connect to the SQL Server instance by using SQL Server Management Studio (SSMS).
- Right-click the SQL Server instance in the Object Explorer and select Properties > Database Settings.
- Under Database Default locations, make sure that the folders in Data and Log are correct.
- In the SQL Server Configuration Manager, select SQL Server Services, double-click the affected SQL Server Service, select the Advanced tab, and make sure the value of Data Path is correct. The value is grayed out and can't be modified. However, if you want to correct it, follow Method 2 in Error that Data or Log directory in the registry is not valid when installing SQL Server Cumulative Update or a Service Pack to modify the SQLDataRoot registry entry.
- Retry the CU or SP installation.
Misconfigured Windows Server Failover Clustering (WSFC) nodes
For smooth functioning and maintenance of a SQL Server Failover Cluster Instance (FCI), follow the best practices described in Before Installing Failover Clustering and Failover Cluster Instance administration & maintenance. If you experience errors when you apply a CU or an SP, check the following conditions:
- Make sure that the Remote Registry service is active and running on all nodes of the WSFC cluster.
- If the service account for SQL Server isn't an administrator in your Windows cluster, make sure that administrative shares (C$ and so on) are enabled on all of the nodes. For more information, see Overview of problems that may occur when administrative shares are missing. If these shares aren't configured correctly, you might notice one or more of the following symptoms when you try to install a CU or SP:
- The update takes a long time to run or doesn't respond. Setup logs don't reveal any progress.
- Setup logs contain messages such as the following:
The network path was not found.
System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.
Additional information
- For a complete list of currently available updates for your SQL Server version and download locations, see Determine the version, edition, and update level - SQL Server.
- For more information about supportability and servicing timelines for your SQL Server version, see Microsoft Product Lifecycle Page.
- For information about servicing models for different versions of SQL Server, see Incremental Servicing Model for SQL Server Updates and Modern Servicing Model for SQL 2017 and later versions.
- For general information about how to update SQL Server, see Install SQL Server Servicing Updates.
- For information about security updates for SQL Server and other products, see Security Update Guide.
- For information about the standard terminology that's associated with Microsoft updates, see Description of the standard terminology that is used to describe Microsoft software updates.
- To resolve setup issues that might occur in highly secure environments, see SQL Server installation fails if the Setup account doesn't have certain user rights.