Cookbook version
[Version of the cookbook where you are encountering the issue]
5.5.0
Chef-client version
[Version of chef-client in your environment]
chef-client 14.12.9-1-x64.msi installed in vm template.
chef-server 14.11.21 with manage
Platform Details
[Operating system distribution and release version. Cloud provider if running in the cloud]
-Windows 2016 DataCenter
-vSphere 6.7.0.30000 machine template.
-vRA 7.5.0 (Build: 10053500)
-Chef Server plug-in for vRealize Orchestrator 1.0.0 - chef/vmware collaboration.
-Default workflow that came with the Chef server plugin - "CHEF\Windows Node Management\VMTools\Windows VMTools Chef-client first run Validatorless workflow"
-SQL Server enterprise core 2016
Scenario:
[What you are trying to achieve and you can't?]
Execute vRA request which provisions a VM and then calls the vRO chef plugin workflow to add the provisioned VM to Chef server as a client and node (which occurs successfully) and then execute a runlist containing this cookbook to install sql server 2016 enterprise core.
Insallation fails with the following errors:
1.SQL core installer complains about WMI service cannot be started. There are COM+ registry errors in the windows event viewer at the exact time or just seconds before associated with my local administrator AD domain account not having permissions to the runtimebroker com+ application. The event viewer also shows that the SQL Server ScenarioEngine.exe registry keys in use leaked, which results in windows closing the handle before SQL Server ScenarioEngine.exe is done using it for the install.
-
"SQL Server Setup was not able to access domain 'WinNT://XXXX' to validate user account 'XXXXX'. The SQL Server service account login or password is not valid.” However, the service account password is correct and validated using run as powershell credentials test running notepad or some other app as that user. SQL installer is trying to connect to AD via the runtimebroker COM+ app to validate the service account the SQL configuration.ini unattend file is setting on the windows sql services, but cannot access runtimebroker due to the registry unloading the key necessary as indicated in the error above. It seems to pretty consistently alternate between these 2 errors. I can run it and get WMI error, then run again and get user account access error, then run again and get WMI, then run again and get user account access error.
-
I occasionally will get "could not read key from registry" without getting either of the first 2 errors.
IF I login to the VM prior to the server.rb recipe running as the local admin AD domain user account chef is running the cookbook under, the sql installer completes successfully without errors.
IF set the security policy "do not forcefully unload registry when user logs off" in the registry of the template, or via a reg key resource before the package resource in the server.rb recipe, the installation completes successfully without errors.
Steps to Reproduce:
[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this cookbook or any resources it includes?]
I am only using the server.rb and configure.rb recipes from the sql_server cookbook. I have commented out options that we don't need in the server.rb recipe, and had to change the OPTIONS string to the following for it to work:
"/Q /ACTION=#{node['cs_sql_server']['setup_action']} #{passwords_options} /ConfigurationFile=#{config_file_path} /IAcceptSQLServerLicenseTerms=#{node['cs_sql_server']['accept_eula']}"
I added 2 custom recipes, one to run first which bootstraps the vm with custom applications, then server.rb followed by configure.rb, followed by custom recipe to execute my custom apps.
ALL recipes run successfully and complete without issue when executed via chef-solo command logged into the vm as admin.
- I have a windows template in vSphere that contains the chef-client installed.
- vRA blueprint clones the template and powers on, joins domain, adds local users specified to admins, updates vmtools.
- vRA executes the vRO Chef Server plug-in for vRealize Orchestrator's default worklfow named "CHEF\Windows Node Management\PowerShell\Windows PS Chef-client first run Validatorless workflow" and passes required parameters.
- The workflow successfully executes my custom recipe first and then server.rb
- Server.rb completes with errors.
- Login and review SQL installation logs to find the errors listed above.
IF I login to the VM prior to the server.rb recipe running as the local admin AD domain user account chef is running the cookbook under, the sql installer completes successfully without errors.
IF set the security policy "do not forcefully unload registry when user logs off" in the registry of the template, or via a reg key resource before the package resource in the server.rb recipe, the installation completes successfully without errors.
Expected Result:
[What are you expecting to happen as the consequence of above reproduction steps?]
I expect the sql installer to error with the errors indicated.
Actual Result:
[What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.]
DCOM errors at the time of the sql install error in the logs:
The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{D63B10C5-BB46-4990-A94F-E40B9D520160}
and APPID
{9CA88EE3-ACB7-47C8-AFC4-AB702511C276}
to the user DOMAIN\USER SID (S-1-5-21-221447426-1814128558-2251880862-1653) from address LocalHost (Using LRPC) running in the application container Unavailable SID (Unavailable). This security permission can be modified using the Component Services administrative tool.
Registry key leaked event viewer errors:
`Windows detected your registry file is still in use by other applications or services. The file will be unloaded now. The applications or services that hold your registry file may not function properly afterwards. No user action is required.
DETAIL -
11 user registry handles leaked from \Registry\User\S-1-5-21-221447426-1814128558-2251880862-1653:
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Policies
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Microsoft\Internet Explorer\Main
Process 2836 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\setup.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Microsoft\Windows NT\CurrentVersion
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\Control Panel\International
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Microsoft\Internet Explorer\Security
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap
1 user registry handles leaked from \Registry\User\S-1-5-21-221447426-1814128558-2251880862-1653_Classes:
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653_Classes
1 user registry handles leaked from \Registry\User\S-1-5-21-221447426-1814128558-2251880862-1653:
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653\SOFTWARE\Microsoft\Windows NT\CurrentVersion
2 user registry handles leaked from \Registry\User\S-1-5-21-221447426-1814128558-2251880862-1653_Classes:
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653_Classes
Process 1672 (\Device\HarddiskVolume4\00.Install\SQL Server 2016 Enterprise Core\x64\ScenarioEngine.exe) has opened key \REGISTRY\USER\S-1-5-21-221447426-1814128558-2251880862-1653_Classes
`
SQL install log errors:
`C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20190509_104359\Detail.txt
(01) 2019-05-09 10:44:04 Slp: Running Action: ValidateSettingsAgainstScenario
(01) 2019-05-09 10:44:04 Slp: Scenario: Install
(01) 2019-05-09 10:44:04 Slp: Completed Action: ValidateSettingsAgainstScenario, returned True
(01) 2019-05-09 10:44:04 Slp: ----------------------------------------------------------------------
(01) 2019-05-09 10:44:04 Slp: Running Action: FinalCalculateSettings
(06) 2019-05-09 10:44:04 Slp: The directory monitor thread is interrupted due to the following exception while monitoring the notifications for directory 'C:\Program Files (x86)'
(06) 2019-05-09 10:44:04 Slp: The following is an exception stack listing the exceptions in outermost to innermost order
(06) 2019-05-09 10:44:04 Slp: Inner exceptions are being indented
(06) 2019-05-09 10:44:04 Slp:
(06) 2019-05-09 10:44:04 Slp: Exception type: Microsoft.SqlServer.Configuration.Sco.MonitorThreadInterruptedException
(06) 2019-05-09 10:44:04 Slp: Message:
(06) 2019-05-09 10:44:04 Slp: The directory monitor thread is interrupted. Message: 'The directory monitor thread is interrupted due to a StopMonitor call.'
(06) 2019-05-09 10:44:04 Slp: HResult : 0x86a40016
(06) 2019-05-09 10:44:04 Slp: FacilityCode : 1700 (6a4)
(06) 2019-05-09 10:44:04 Slp: ErrorCode : 22 (0016)
(06) 2019-05-09 10:44:04 Slp: Data:
(06) 2019-05-09 10:44:04 Slp: ErrorMessage = The directory monitor thread is interrupted due to a StopMonitor call.
(06) 2019-05-09 10:44:04 Slp: WatsonData = Microsoft.SqlServer.Configuration.Sco.MonitorThreadInterruptedException@22
(06) 2019-05-09 10:44:04 Slp: Stack:
(06) 2019-05-09 10:44:04 Slp: at Microsoft.SqlServer.Configuration.Sco.DirectoryMonitor.Monitor()
……..
(01) 2019-05-09 10:44:04 Slp: Initializing rule : Windows Management Instrumentation (WMI) service
(01) 2019-05-09 10:44:04 Slp: Rule is will be executed : True
(01) 2019-05-09 10:44:04 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.WmiServiceInfo
(01) 2019-05-09 10:44:05 Slp: Cluster Service is not running : Exception is as follows System.Runtime.InteropServices.COMException (0x80040150): Could not read key from registry
at System.Management.ThreadDispatch.Start()
at System.Management.ManagementScope.Initialize()
at System.Management.ManagementObjectSearcher.Initialize()
at System.Management.ManagementObjectSearcher.Get()
at Microsoft.SqlServer.Configuration.SetupExtension.WmiServiceInfo.Microsoft.SqlServer.Configuration.RulesEngineExtension.IRuleInitialize.Init(String ruleId)
at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.Execute(Boolean stopOnFailure)
(01) 2019-05-09 10:44:05 Slp: Rule initialization failed - hence the rule result is assigned as Failed
(01) 2019-05-09 10:44:05 Slp: Initializing rule : Consistency validation for SQL Server registry keys
(01) 2019-05-09 10:44:05 Slp: Rule is will be executed : True
(01) 2019-05-09 10:44:05 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.AclPermissionsFacet
(01) 2019-05-09 10:44:05 Slp: Launching external tool: e:\00.install\sql server 2016 enterprise core\x64\FixSqlRegistryKey_x64.exe
(01) 2019-05-09 10:44:05 Slp: ------------------------------------------------------------
(08) 2019-05-09 10:44:05 Slp: HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server - Set SE_DACL_AUTO_INHERITED.
(08) 2019-05-09 10:44:05 Slp: HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\130 - Set SE_DACL_AUTO_INHERITED.
(01) 2019-05-09 10:44:05 Slp: ------------------------------------------------------------
(01) 2019-05-09 10:44:05 Slp: e:\00.install\sql server 2016 enterprise core\x64\FixSqlRegistryKey_x64.exe exit code: 0
(01) 2019-05-09 10:44:05 Slp: Launching external tool: e:\00.install\sql server 2016 enterprise core\x64\FixSqlRegistryKey_x86.exe
(01) 2019-05-09 10:44:05 Slp: ------------------------------------------------------------
(09) 2019-05-09 10:44:05 Slp: HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server - OK.
(09) 2019-05-09 10:44:05 Slp: HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\130 - OK.
(01) 2019-05-09 10:44:05 Slp: ------------------------------------------------------------
(01) 2019-05-09 10:44:05 Slp: e:\00.install\sql server 2016 enterprise core\x64\FixSqlRegistryKey_x86.exe exit code: 0
(01) 2019-05-09 10:44:05 Slp: Rule 'AclPermissionsFacet' detection result: AreSqlAclPermissionsCanonical= True
(01) 2019-05-09 10:44:05 Slp: Evaluating rule : AclPermissionsFacet
(01) 2019-05-09 10:44:05 Slp: Rule running on machine: HOSTNAME
(01) 2019-05-09 10:44:05 Slp: Rule evaluation done : Succeeded
(01) 2019-05-09 10:44:05 Slp: Rule evaluation message: SQL Server registry keys are consistent and can support SQL Server installation or upgrade.
(01) 2019-05-09 10:44:05 Slp: Initializing rule : Long path names to files on SQL Server installation media
(01) 2019-05-09 10:44:05 Slp: Rule is will be executed : True
(01) 2019-05-09 10:44:05 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.MediaPathLenghtFacet
(01) 2019-05-09 10:44:05 Slp: Rule 'MediaPathLength' INSTALLMEDIAPATH length is 56
(01) 2019-05-09 10:44:05 Slp: Evaluating rule : MediaPathLength
(01) 2019-05-09 10:44:05 Slp: Rule running on machine: HOSTNAME
(01) 2019-05-09 10:44:05 Slp: Rule evaluation done : Succeeded
(01) 2019-05-09 10:44:05 Slp: Rule evaluation message: The SQL Server installation media is not too long.
(01) 2019-05-09 10:44:05 Slp: Initializing rule : SQL Server Setup Product Incompatibility
(01) 2019-05-09 10:44:05 Slp: Rule is will be executed : True
(01) 2019-05-09 10:44:05 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.SetupCompatibilityCheck
(01) 2019-05-09 10:44:05 Slp: Sco: Attempting to create base registry key HKEY_LOCAL_MACHINE, machine
(01) 2019-05-09 10:44:05 Slp: Sco: Attempting to open registry subkey SOFTWARE\Microsoft\Microsoft SQL Server\130\Bootstrap\Incompatibilities
(01) 2019-05-09 10:44:05 Slp: Searching for reg path SOFTWARE\Microsoft\Microsoft SQL Server\130\Bootstrap\Incompatibilities. Open subkey result is False
(01) 2019-05-09 10:44:05 Slp: Regkey not present. No incompatibilities
(01) 2019-05-09 10:44:05 Slp: Incompatibility detected = False
(01) 2019-05-09 10:44:05 Slp: Evaluating rule : SetupCompatibilityCheck
(01) 2019-05-09 10:44:05 Slp: Rule running on machine: HOSTNAME
(01) 2019-05-09 10:44:05 Slp: Rule evaluation done : Succeeded
(01) 2019-05-09 10:44:05 Slp: Rule evaluation message: Setup has not detected any incompatibilities.
(01) 2019-05-09 10:44:05 Slp: Initializing rule : .NET 2.0 and .NET 3.5 Service Pack 1 update for Windows 2008 R2 and Windows 7 (KB958488)
(01) 2019-05-09 10:44:05 Slp: Rule is will be executed : True
(01) 2019-05-09 10:44:05 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.NoRebootPackageFacet
(01) 2019-05-09 10:44:05 Slp: Evaluating rule : NoRebootPackage
(01) 2019-05-09 10:44:05 Slp: Rule running on machine: HOSTNAME
(01) 2019-05-09 10:44:05 Slp: Rule evaluation done : Succeeded
(01) 2019-05-09 10:44:05 Slp: Rule evaluation message: This computer has the required update package.
(01) 2019-05-09 10:44:05 Slp: Initializing rule : Edition WOW64 platform
(01) 2019-05-09 10:44:05 Slp: Rule is will be executed : True
(01) 2019-05-09 10:44:05 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.FacetWOW64PlatformCheck
(01) 2019-05-09 10:44:05 Slp: Current machineArchitecture = x64
(01) 2019-05-09 10:44:05 Slp: Setup package is 64 bit, Marking check for WOW Supported32bitSetup as passed
(01) 2019-05-09 10:44:05 Slp: Current machineArchitecture is 64bit
(01) 2019-05-09 10:44:05 Slp: Rule 'FacetWOW64PlatformCheck' results: Supported32bitSetup=True
(01) 2019-05-09 10:44:05 Slp: Evaluating rule : FacetWOW64PlatformCheck
(01) 2019-05-09 10:44:05 Slp: Rule running on machine: HOSTNAME
(01) 2019-05-09 10:44:05 Slp: Rule evaluation done : Succeeded
(01) 2019-05-09 10:44:05 Slp: Rule evaluation message: SQL Server Setup is supported on this operating system platform.
(01) 2019-05-09 10:44:05 Slp: Saved to directory.......C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20190509_104359\SystemConfigurationCheck_Report.htm
(01) 2019-05-09 10:44:05 Slp: Sco: Attempting to create directory C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20190509_104359\resources
(01) 2019-05-09 10:44:05 Slp: Sco: Attempting to create directory C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20190509_104359\resources, security descriptor
(01) 2019-05-09 10:44:05 Slp: Sco: Directory 'C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20190509_104359\resources' already exists, skipping creation, moving to set security descriptor.
(01) 2019-05-09 10:44:05 Slp: Sco: Attempting to set security descriptor for directory C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20190509_104359\resources, security descriptor
(01) 2019-05-09 10:44:05 Slp: Sco: SDDL is NULL/empty and overwriteSecurityDescriptor is false, so nothing to do, return.
(01) 2019-05-09 10:44:05 Slp: Rules evaluation report is available now at C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20190509_104359\SystemConfigurationCheck_Report.htm
(01) 2019-05-09 10:44:05 Slp: Error: Action "Microsoft.SqlServer.Configuration.RulesEngineExtension.RunRulesAction" threw an exception during execution.
(01) 2019-05-09 10:44:05 Slp: Microsoft.SqlServer.Setup.Chainer.Workflow.ActionExecutionException: The Windows Management Instrumentation (WMI) service cannot be started. To continue with the installation, you must troubleshoot and repair your Windows Management Instrumentation (WMI) service. ---> Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngineRuleFailureException: The Windows Management Instrumentation (WMI) service cannot be started. To continue with the installation, you must troubleshoot and repair your Windows Management Instrumentation (WMI) service.
(01) 2019-05-09 10:44:05 Slp: at Microsoft.SqlServer.Configuration.RulesEngineExtension.RunRulesAction.ExecuteAction(String actionId)
`