Skip to content
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

Conversation

Iristyle
Copy link
Contributor

@Iristyle Iristyle commented Jun 6, 2016

  • 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 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.

@Iristyle Iristyle changed the title (MODULES-3449) Stop Windows pxp-agent service … (MODULES-3449) Stop Windows pxp-agent service Jun 6, 2016
@@ -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.
Copy link
Contributor

@glennsarti glennsarti Jun 6, 2016

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?

Copy link
Contributor Author

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.
@Iristyle Iristyle force-pushed the ticket/master/MODULES-3449-shutdown-pxp-agent-service-on-Windows-upgrades branch from b6bf949 to 9caa377 Compare June 6, 2016 22:50
@glennsarti
Copy link
Contributor

👍 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.
@Iristyle Iristyle force-pushed the ticket/master/MODULES-3449-shutdown-pxp-agent-service-on-Windows-upgrades branch from 9caa377 to fc2bd92 Compare June 6, 2016 23:31
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
Copy link
Contributor

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.

Copy link
Contributor Author

@Iristyle Iristyle Jun 6, 2016

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.

@MikaelSmith MikaelSmith merged commit a136feb into puppetlabs:master Jun 7, 2016
@Iristyle Iristyle deleted the ticket/master/MODULES-3449-shutdown-pxp-agent-service-on-Windows-upgrades branch June 7, 2016 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants