Error installing SQL Server Database Engine Services Instance Features - The User Log directory in the registry is not valid We have a SQL Server:

Microsoft SQL Server 2017 (RTM-CU14-GDR) (KB4494352) - 14.0.3103.1 (X64)   Mar 22 2019 22:33:11  Enterprise Edition (64-bit) on Windows Server 2016 Datacenter 10.0  (Build 14393: ) (Hypervisor)

Tried to install &quot;Cumulative Update Package 18 for SQL Server 2017 - KB4527377&quot;
https://www.microsoft.com/en-us/download/details.aspx?id=56128
Setup was doing something for 15 min, installing and updating files, stopping / starting services, it looked like its going to succeed, but in the end it showed this:

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 Log directory in the registry is not valid.
Verify DefaultLog key under the instance hive points to a valid directory.
Error code: 0x851A0044
Visit https://go.microsoft.com/fwlink?LinkId=20476&amp;ProdName=Microsoft+SQL+Server&amp;EvtSrc=setup.rll&amp;EvtID=50000&amp;ProdVer=14.0.3257.3&amp;EvtType=0xD8FB5EBA%400x97A656BB%401306%4068&amp;EvtType=0xD8FB5EBA%400x97A656BB%401306%4068 to get help on troubleshooting.


What's preventing CU18 from installing ?
Ok I found this article

https://blog.sqlauthority.com/2015/05/16/sql-server-service-pack-error-the-user-data-directory-in-the-registry-is-not-valid-verify-defaultdata-key-under-the-instance-hive-points-to-a-valid-directory/

It says my CU update fails because of Default Log path does not exist anymore

Default Log path can be checked by one of below ways:


Execute T-SQL


exec [master].sys.xp_regread 
    @rootkey='HKEY_LOCAL_MACHINE', 
    @key='SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQLServer\', 
    @value_name = 'DefaultLog'



SSMS -> Right Click Server -> Properties -> Database Settings -> Database Default Locations
Regedit -> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQLServer\DefaultLog


Updated Default Log path to point to existing location, and CU18 update installed fine without any errors