Project

General

Profile

Bug #4387

Upgrade rudder-agent can fail if cf-serverd/cf-execd fails to stop gracefully

Added by Dennis Cabooter over 6 years ago. Updated about 5 years ago.

Status:
Released
Priority:
1
Category:
Packaging
Target version:
Severity:
User visibility:
Effort required:
Priority:

Description

While upgrading rudder-server-root 2.9.1 to 2.9.2 on Ubuntu 12.04 LTS the following happened:

rudder-agent[11400]: [ALERT] cf-serverd still running (PID 19426), try: /etc/init.d/rudder-agent forcestop
dpkg: error processing rudder-agent (--configure): subprocess installed post-installation script returned error exit status 1

I waited for the install to finish, then killed all cf- processes and did a "apt-get -f install". The installation upgraded rudder-agent. However, rudder-agent didn't start, because of this:

rudder-agent[19222]: [ALERT] The /opt/rudder/etc/disable-agent flag file is present. The agent cannot be started.

I saw this because I did a "/etc/init.d/rudder-server-root restart". I did that because all nodes had No Answer reports and all compliances were on 0%.

#1

Updated by Vincent MEMBRÉ over 6 years ago

  • Assignee set to Matthieu CERDA
  • Priority changed from N/A to 1

Rudder-agent should not fail during upgrade, or at least should not keep the disable-agent file.

Maybe we could use forcestop instead of stop in the upgrade process.

Is there a way to have a "clean" process when an upgrade fail ? So that we could delete disable-agent if the file is present in case of failure.

#2

Updated by Jonathan CLARKE over 6 years ago

  • Status changed from New to 8

Vincent MEMBRÉ wrote:

Rudder-agent should not fail during upgrade, or at least should not keep the disable-agent file.

Maybe we could use forcestop instead of stop in the upgrade process.

I suggest:

/etc/init.d/rudder-agent stop || /etc/init.d/rudder-agent forcestop

Is there a way to have a "clean" process when an upgrade fail ? So that we could delete disable-agent if the file is present in case of failure.

Not easily. But we could use the same approach as above:

/etc/init.d/rudder-agent stop || /etc/init.d/rudder-agent forcestop || rm -f /opt/rudder/etc/disable-agent
#3

Updated by Nicolas CHARLES over 6 years ago

Caution, with this approach

/etc/init.d/rudder-agent stop || /etc/init.d/rudder-agent forcestop || rm -f /opt/rudder/etc/disable-agent

if the file /opt/rudder/etc/disable-agent was there before upgrading, we shouldn't remove it

#4

Updated by Dennis Cabooter over 6 years ago

I'm not a Rudder dev, but is the Rudder server not completely useless with /opt/rudder/etc/disable-agent in place? I would remove it anyway.

#5

Updated by Vincent MEMBRÉ about 6 years ago

  • Target version changed from 2.9.3 to 2.9.4
#6

Updated by Vincent MEMBRÉ about 6 years ago

  • Target version changed from 2.9.4 to 2.9.5
#7

Updated by Vincent MEMBRÉ almost 6 years ago

  • Target version changed from 2.9.5 to 2.9.6
#8

Updated by Jonathan CLARKE almost 6 years ago

  • Target version changed from 2.9.6 to 2.9.7
#9

Updated by Jonathan CLARKE almost 6 years ago

  • Target version changed from 2.9.7 to 150
#10

Updated by Vincent MEMBRÉ almost 6 years ago

  • Target version changed from 150 to 2.10.4
#11

Updated by Nicolas PERRON almost 6 years ago

  • Target version changed from 2.10.4 to 2.10.5
#12

Updated by Jonathan CLARKE almost 6 years ago

  • Project changed from Rudder to packages
  • Subject changed from Upgrade rudder-server-root 2.9.1 to 2.9.2 fails on rudder-agent on Ubuntu 12.04 LTS to Upgrade rudder-agent can fail if cf-serverd/cf-execd fails to stop gracefully
  • Status changed from 8 to Pending technical review
  • Assignee changed from Matthieu CERDA to Benoît PECCATTE
  • Target version changed from 2.10.5 to 2.6.18
  • Pull Request set to https://github.com/Normation/rudder-packages/pull/462

Let's start with the simple approach of ```/etc/init.d/rudder-agent stop || /etc/init.d/rudder-agent forcestop```. This should solve any cases where this fails.

If we still need to clean up the flag we left after that, we'll see about how to do that if it turns out to be necessary.

#13

Updated by Jonathan CLARKE over 5 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100

Applied in changeset commit:ea727140ee6b319ea34d86829df36f2b64c567ed.

#14

Updated by Benoît PECCATTE over 5 years ago

Applied in changeset commit:97d9137d8544004edef0ea67ec41f94d63755a8a.

#15

Updated by Matthieu CERDA over 5 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 2.6.18, which was released today.
Check out:

#16

Updated by Benoît PECCATTE about 5 years ago

  • Project changed from packages to Rudder
  • Category set to Packaging

Also available in: Atom PDF