Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
-
Night's Watch
-
2
-
NW - 2020-04-01
-
Not Needed
-
Needs Assessment
Description
On Windows, if the puppet or pxp-agent services are running before the puppet_agent module upgrades the puppet-agent package, and the module is unable to reset one of the services (such as due to PCP-893) then the puppet_agent_upgrade.pid file is never removed.
This is because install_puppet.ps1 resets the service, but if that fails:
Set-Service : Failed to start service 'Puppet PXP Agent (pxp-agent)'.
|
At C:\Windows\TEMP\install_puppet.ps1:253 char:9
|
+ Set-Service $service.Name -Status $service.Status
|
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Set-Service], ServiceCommandException
|
+ FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.SetServiceCommand
|
Then it never calls Unlock-Installation:
} finally {
|
Reset-PuppetServices $services_before
|
Unlock-Installation $install_pid_lock
|
}
|
The code should add another level of try/finally to ensure we always unlock if even reset raises.