
You are getting below error while installing the SQL Server service pack or cumulative updates.
Action required:
Use the following information to resolve the error, and then try the setup process again.
Feature failure reason:
An error occurred during the setup process of the feature.
Error details:
§ Error installing SQL Server Database Engine Services Instance Features
The User Data directory in the registry is not valid.
Verify DefaultData key under the instance hive points to a valid directory.
Error code: 0x851A0043

Solution
The issue occurred due to invalid default locations for data and log file.
To fix this, launch the SQL Server Management Studio. Right click on the server and select Properties.

Open Database Settings page and define the correct database default location as in step 2. Click OK and you can now retry your upgrade.

Alternatively, you can use Registory Editor to perform the same changes. Locate and then click the registry subkey,
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server[MSSQL.x]\MSSQLServer.
In the right panel,
- click the DefaultData registry entry and enter the correct path
- click the DefaultLog registry entry and enter the correct path


