info@techdevops.com | 437-991-3573 | Data Engineering Services
TechDevOps.com
Resources Tools
Experts in Microsoft SQL Server on Windows, Linux, Containers | Clusters, Always On, FCI | Migrations, Cloud, Performance



The User Data directory in the registry is not valid. Error code: 0x851A0043
by BF (Principal Consultant; Architecture; Engineering)
2016-12-15








I was recently tasked to configure a new Microsoft SQL Server Transactional Replication Publication that would replicate data to Azure Virtual Machines. The source was an on premise SQL Server 2014 SP1 and the Azure destinations were running SQL Server 2014 SP2. There was already an existing Publication on these exact databases so I thought a low chance of any issues with this new Publication & Subscription setup. So I proceeded to the setup and the new Publication was quick & error free. I next added the new Subscriber and it would not allow me to select any Subscription database! It instead gave the below error message:


"You must enter a subscription database name for Subscriber xyx."




The Replication setup would not proceed. At this point I noticed the SQL Server versions were different and figured that was the cause. With the goal of matching the versions, I next went to the Subscriber and uninstalled SP2, rebooted the server, installed SP1 - which failed with the below error:


"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"




The issue with the DefaultData was due to us a few weeks earlier adding new SSD's to this Virtual Machine and another staff had removed the non-SSD's. Well, those non-SSD's had Registry entries within the DefaultData and DefaultLog keys. We updated those registry key values to valid drives paths, reinstalled SP1 and that issue was resolved. (Note this was the SQL Server Default Instance installed (no Named Instances))

Next, I went back to the Replication setup and now the 2nd Subscriber database was able to be added!!!