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:
(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
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 Registry | Error Message |
DefaultData | The User Data directory in the registry is not valid. Verify DefaultData key under the instance hive points to a valid directory. |
DefaultLog | The User Log directory in the registry is not valid. Verify DefaultLog key under the instance hive points to a valid directory. |
SQLDataRoot | The 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
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)
41 Comments. Leave new
Thank you for this article it solved my issue :)
Glad it helped you. Thanks.
Hi Pinal,
I had a similar issue in my recent upgrade and corrected the path for the default data and the upgrade went fine but then I had another different issue which I thought would run through you to see if you had come across this anytime.
Recently we upgraded a data warehouse server to SQL2012 SP2 from SQL2008 SP4 and everything went fine except for the SQL server replication that failed and the error log shows ‘Error executing sp_vupgrade_replication’.
We tried to run that procedure manually in the server and it gave the following error
Msg 33094, Level 16, State 1, Procedure sp_helpdistributor, Line 180
An error occurred during Service Master Key decryption
Msg 20036, Level 16, State 1, Procedure sp_vupgrade_registry_custom_resolver_katmai, Line 32
The Distributor has not been installed correctly.
The server is the publisher and the distributor is a different server.
But the replication is all running fine with no issues, any idea about this error and how to resolve this?
Would appreciate your help.
Do you have any error message in ERRORLOG about encryption or decryption at the beginning?
I just see these at 11:47:06 PM
Error executing sp_vupgrade_replication
An error occurred during Service Master Key decryption
And then this at 11:47:45 PM
Service Master Key could not be decrypted using one of its encryptions. See sys.key_encryptions for details.
Doesn’t look like an easy to fix. I would suggest contact Microsoft SQL Support via forum or support case.
Ok,Thank you Pinal. Appreciate your immediate response.
What should the path be corrected to?
i have the same question. “What should the path be corrected to?”
Thanks Pinal, it solved the issue on my 2014.
I am glad to read that Jay!
Hi, I have ran into same issue. I updated the default log file path later when learned about the error. My servers are under AlwaysOn setup.so whenever I am updating the default directory using Management Studio, it doesn’t seem to be updating as when I refresh it, it goes back to old location. Though my registry entry has been updated. Could you please help me figure out what could be the reason behind this.
Restart is needed.
Hi Dave, Thanks for being so dedicated and helping all of us grow. Once again you saved me several hours of searching for an answer to a SQL question. Your answers really work.
Thank you – solved me SQL Server 2012 SP3 issue.
Thanks – saved me.
Thanks — that solved my problem :)
Many Thanks for solving my Problem. It was very Helpful, cause after editing the Registry and restart the SP- Installation, the error didn’t occure an longer :-)
You, sir, saved my half-a-year! Those file paths are also accessible from SQL Server Management Console, through alt-menu on server in Object Explorer –> Database Settings. Seems that I had changed those paths point to a disk, that was later removed from the VM for unknown reasons.
Typoed in a hurry, accessible from SQL Server Management Studio, through alt-menu on server in Object Explorer –> Properties –> Database Settings page.
Thank you for your fix :) Working !!! Good Bless you :P
Amiga Rules :)
My pleasure.
I was attempting to update a SQL Server 2012 to SP4 recently, but it failed due to this same issue. Your remedy solved that issue
Thank you!!!
Perfect. Thanks JD.
Pinal, ran into this issue during a recent upgrade and as you know, a failed upgrade is not a happy situation. I searched for the error message and was very excited when I saw your site come up first. I knew I was going to get a very straightforward article with something very easy to use right away… and I did. Thank you.
Thanks Mark. I am happy to see the confidence you have in my blogs.
You are Excellent Sir ….. Amazing Short and perfect explanation
Thank you, it saved me
Thanks! That looks like it’s the cause of my problem on this server.
Extremely helpful with SQL server 2018 HA also – Thanks
I meant to say SQL Server 2017
VERSION UPGRADE TO:
14.0.3048.4 (latest build) KB4466404
VERSION COMING FROM:
14.0.1000.169