New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(MODULES-3449) Stop Windows pxp-agent service #124
(MODULES-3449) Stop Windows pxp-agent service #124
Conversation
@@ -15,7 +15,13 @@ FOR /F "tokens=*" %%A IN ('tasklist /FI "PID eq %AGENT_PID%" /NH') DO set _task= | |||
echo %_task% | findstr "No tasks are running" >nul | |||
IF NOT %errorlevel% == 0 ( GOTO wait_for_pid ) | |||
|
|||
start /wait msiexec.exe /qn /norestart /i "<%= @_msi_location %>" /l*v "<%= @_logfile %>" PUPPET_MASTER_SERVER="<%= @_puppet_master %>" | |||
REM This *must* occur after Puppet Agent has finished applying its | |||
REM prior catalog which manages the pxp-agent service state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you mention why it must occur if it's so important? Unless the commit message is all that's required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All set
- Previously, upgrades could fail as a result of the pxp-agent service holding file locks. While we have been previously aware of the potential for this issue, given pxp-agent runs under nssm.exe on Windows, prior investigation had shown this to not be an issue on silent installations (see PA-65). However, in practice, while upgrading from puppet-agent 1.4.2 to puppet-agent 1.5.0, a running pxp-agent service is preventing installs from proceeding as requested with a 1603 failure. NSSM.exe is not affiliated with the pxp-agent service in the MSI and therefore the Restart Manager has no understanding that it will be later shutdown and unlocked. The solution is to simply request a `net stop pxp-agent` prior to running the MSI. It's very important that this be done *after* the puppet run responsible for triggering the upgrade has been performed. If the pxp-agent service shutdown occurs before, then the puppet run will typically turn it back on as part of managing the node with the Puppet Enterprise modules.
b6bf949
to
9caa377
Compare
👍 From me |
- Specifying the `x` for logging includes extra debugging information that can be useful when installations fail. For instance, it will produce more verbose information from the Restart Manager.
9caa377
to
fc2bd92
Compare
REM sets its startup type, which prevents installs from proceeding. | ||
REM This may fail on agents without pxp-agent, but since this is not | ||
REM run interactively and the next command sets ERRORLEVEL, it's OK. | ||
net stop pxp-agent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you determine the issue?
Also keep in mind that 3.x agents upgrading won't have this - so if it fails that should be ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, was able to fix the upgrade with just the net stop pxp-agent
here. Unfortunately, Restart Manager doesn't tell us what files are locked, though it's safe to assume its nssm.exe
. Still don't know why this behavior deviates from what we observed in PA-65 though.
Your note about 3.x is in the comment block already.
Previously, upgrades could fail as a result of the pxp-agent service
holding file locks. While we have been previously aware of the
potential for this isssue, given pxp-agent runs under nssm.exe on
Windows, prior investigation had shown this to not be an issue on
silent installations (see PA-65).
However, in practice, while upgrading from puppet-agent 1.4.2 to
puppet-agent 1.5.0, a running pxp-agent service is preventing
installs from proceeding as requested with a 1603 failure. NSSM.exe
is not affiliated with the pxp-agent service in the MSI and therefore
the Restart Manager has no understanding that it will be later
shutdown and unlocked.
The solution is to simply request a
net stop pxp-agent
prior torunning the MSI. It's very important that this be done after the
puppet run responsible for triggering the upgrade has been performed.
If the pxp-agent service shutdown occurs before, then the puppet run
will typically turn it back on as part of managing the node with the
Puppet Enterprise modules.