Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
Description
Basic Info
Module Version: puppetlabs-sqlserver 2.2.0
Puppet Version: 6.0.1
OS Name/Version: Windows 2012R2 server
When the sqlserver_instances fact resolves, one of the first things it does is check for values in HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\Instance Names. It then iterates through these names to find other registry keys containing the version of each instance.
See code here: https://github.com/puppetlabs/puppetlabs-sqlserver/blob/master/lib/puppet_x/sqlserver/features.rb#L75-L89
Today I encountered an issue with a customer where an Instance name was present but the version key was missing:
2019-01-06 14:55:09 -0500 Facter (err): error while resolving custom fact "sqlserver_instances": Failed to open registry key 'HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\MSRS11.@Sharepoint\MSSQLServer\CurrentVersion': The system cannot find the file specified.
|
Still confirming, but I think uninstalling (or removing) an MSSQL instance leaves the registry in this state.
Attaching a registry export that reproduces this problem
Desired Behavior:
If the key HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\<instance_name>\MSSQLServer\CurrentVersion doesn't exist we should assume that it isn't a valid instance and leave it out of the sqlserver_instances fact.
Actual Behavior:
The actual behavior is that you get the error above.