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

As a good SQL Server DBA, I always keep updating my SQL Server on my all VMs with the latest service pack available. During my last installation of service pack 2 on SQL Server 2012, I got below error.

The User Data directory in the registry is not valid. Verify DefaultData key under the instance hive points to a valid directory.

I remember that I have played with some registry keys and now I realized that they are important keys. I looked into the logs based on MSDN articles and found below in Summary.txt file.

Detailed results:
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, and then try the setup process again.
Component name: SQL Server Database Engine Services Instance Features
Component error code: 0x851A0043
Error description: The User Data directory in the registry is not valid. Verify DefaultData key under the instance hive points to a valid directory.

Then I looked in the Detail.txt and found below:

Solarwinds
(01) 2015-05-13 09:19:09 SQLEngine: --SqlEngineSetupPrivate: <strong>Validating path:E:\MSSQL\Data </strong>
(01) 2015-05-13 09:19:09 Slp: Configuration action failed for feature SQL_Engine_Core_Inst during timing Validation and scenario Validation.
(01) 2015-05-13 09:19:09 Slp: The User Data directory in the registry is not valid. Verify DefaultData key under the instance hive points to a valid directory.
(01) 2015-05-13 09:19:09 Slp: The configuration failure category of current exception is ConfigurationValidationFailure
(01) 2015-05-13 09:19:09 Slp: Configuration action failed for feature SQL_Engine_Core_Inst during timing Validation and scenario Validation.
(01) 2015-05-13 09:19:09 Slp: Microsoft.SqlServer.Configuration.SqlEngine.ValidationException: The User Data <strong>directory in the registry is not valid. Verify DefaultData key under the instance hive points to a valid directory.</strong>
(01) 2015-05-13 09:19:09 Slp: at Microsoft.SqlServer.Configuration.SqlEngine.SqlEngineSetupPrivate.CheckIfDirectoryExistsGeneric(String sqlPath, SqlEngineErrorCodes invalidError)
(01) 2015-05-13 09:19:09 Slp: at Microsoft.SqlServer.Configuration.SqlEngine.SqlEngineSetupPrivate.ValidateDataRegistryKeys(EffectiveProperties properties)
(01) 2015-05-13 09:19:09 Slp: at Microsoft.SqlServer.Configuration.SqlEngine.SqlEngineSetupPrivate.Patch(ConfigActionTiming timing, Dictionary`2 actionData, PublicConfigurationBase spcb)
(01) 2015-05-13 09:19:09 Slp: at Microsoft.SqlServer.Configuration.SqlConfigBase.SlpConfigAction.ExecuteAction(String actionId)
(01) 2015-05-13 09:19:09 Slp: at Microsoft.SqlServer.Configuration.SqlConfigBase.SlpConfigAction.Execute(String actionId, TextWriter errorStream)
(01) 2015-05-13 09:19:09 Slp: The following is an exception stack listing the exceptions in outermost to innermost order
(01) 2015-05-13 09:19:09 Slp: Inner exceptions are being indented
(01) 2015-05-13 09:19:09 Slp:
(01) 2015-05-13 09:19:09 Slp: Exception type: Microsoft.SqlServer.Configuration.SqlEngine.ValidationException
(01) 2015-05-13 09:19:09 Slp: Message:
(01) 2015-05-13 09:19:09 Slp: The User Data directory in the registry is not valid. Verify DefaultData key under the instance hive points to a valid directory.

I search for DefaultData key in registry and found at below location

HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQLServer

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 RegistryData-01

As we can see, it is pointing to E:\MSSQL\Data and it was not valid. Later I played with various other keys and found below possible errors.

Invalid Values in RegistryError Message
DefaultDataThe User Data directory in the registry is not valid. Verify DefaultData key under the instance hive points to a valid directory.
DefaultLogThe User Log directory in the registry is not valid. Verify DefaultLog key under the instance hive points to a valid directory.
SQLDataRootThe Database Engine system data directory in the registry is not valid.

SQLDataRoot in locating under HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.MSSQLSERVER\Setup

The cause of all errors was invalid path, which I have messed up. Later I search on the Microsoft site and found that there is a connect item filed by someone

https://connect.microsoft.com/SQLServer/feedback/details/778275/sql-server-2012-sp1-installation-issue

Moral of the story is never playing directly with the registry unless you are sure what they are. I was able to fix the error by correcting the value in DefaultData registry key.

Have you encountered such errors and were able to look at the logs?

Reference: Pinal Dave (https://blog.sqlauthority.com)

Solarwinds
Previous Post
SQL SERVER – WARNING – SQL Server Has Encountered N Occurrence(s) of I/O Requests Taking Longer Than 15 Seconds
Next Post
Interview Question of the Week #020 – What is the Difference Between DISTINCT and GROUP BY?

Related Posts

36 Comments. Leave new

  • Hi,

    Great article however i have the same issue but different reason. My sql server 2016 sp2 cu7 update failed for database engine but i don’t have the reg keys at all for DefaultData or DefaultLog. Everything seems to be working fine despite the fail and @@version is showing 13.0.5366.0 which is what update was to.
    SQL server and databases have correct folders specified in the properties.
    Any idea? Should i create those keys?
    Might be worth mentioning that all instances are named instances.

    Error given:

    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

    Reply
  • Michelle Haarhues
    September 6, 2019 7:08 pm

    Thank you so much for this blog post. This saved me a lot of time searching for the reason why the update failed. I can always count on you for a resolution.

    Reply
  • Helped me a lot during production upgrade which saved me the time a lot

    Reply
  • shailja Mishra
    October 11, 2019 1:38 pm

    Thanks for pointing to the right direction, I have also faced the same issue, and found the path default user directory was not valid it was F drive, and there was no F drive on sever , since my upgrade was failing, I have gone to instance property and change the data , log path to other drive(where my user database are placed)restarted the sever again, reran the patch again. and it was successfull. :)

    Reply
  • Thank you Pinal! This post really helped me out. I was trying to make sense of this error, and it looks like one registry string was missing. Entering it appears to have gotten me to the point where this succeeded!
    I’m planning to attend your SQL Server training session next week in partnership with Quest, I believe. I’m looking forward to it!

    Reply

Leave a Reply

Menu