action ack-reboot is broken on latest/stable

Bug #2008046 reported by DUFOUR Olivier
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
NRPE Charm
Fix Released
High
Mert Kirpici

Bug Description

When trying to run the action "ack-reboot" on nrpe units from "latest/stable" channel, it will fail with the following error :
juju run-action nrpe/0 ack-reboot --wait
unit-nrpe-0:
  UnitId: nrpe/0
  id: "2"
  message: exit status 1
  results:
    ReturnCode: 1
    Stderr: |
      Traceback (most recent call last):
        File "/var/lib/juju/agents/unit-nrpe-0/charm/actions/ack-reboot", line 28, in <module>
          services.manager.reconfigure_services("nrpe-config")
      AttributeError: module 'services' has no attribute 'manager'. Did you mean: 'manage'?
  status: failed
  timing:
    completed: 2023-02-22 05:54:36 +0000 UTC
    enqueued: 2023-02-22 05:54:36 +0000 UTC
    started: 2023-02-22 05:54:36 +0000 UTC

This can be reproduced easily with a simple model (attached on this bug report) with :
* ubuntu Focal/Jammy units with nrpe subordinate from latest/stable
* nagios

By comparison, running an "older" version with "latest/beta" revision 94 do allow us to run the action successfully.

Tags: bseng-942

Related branches

Revision history for this message
DUFOUR Olivier (odufourc) wrote :

Subscribed ~field-high

Eric Chen (eric-chen)
Changed in charm-nrpe:
importance: Undecided → High
status: New → Triaged
tags: added: bseng-942
Changed in charm-nrpe:
assignee: nobody → Mert Kirpici (mertkirpici)
status: Triaged → In Progress
Revision history for this message
Mert Kirpici (mertkirpici) wrote :

A fix to mitigate this has landed on the latest/edge channel. If you still have access to the environment, could you confirm that this issue is resolved?

Changed in charm-nrpe:
status: In Progress → Fix Committed
Revision history for this message
DUFOUR Olivier (odufourc) wrote :
Download full text (6.2 KiB)

Hello,

I've tested the fix and can confirm with latest/edge both work for :
* new units using from the beginning the latest/edge channel ;
* old units by upgrading NRPE charm from latest/stable to latest/edge.
(and confirming it was failing previously on latest/stable in the same model)

#
# Before the upgrade
#
$ juju status
Model Controller Cloud/Region Version SLA Timestamp
nrpe lab-default lab/default 2.9.38 unsupported 03:20:36Z

App Version Status Scale Charm Channel Rev Exposed Message
nagios active 1 nagios latest/stable 58 no ready
nrpe active 1 nrpe latest/edge 99 no Ready
nrpe-old active 1 nrpe latest/stable 97 no Ready
ubuntu 22.04 active 1 ubuntu latest/stable 21 no
ubuntu-focal 20.04 active 1 ubuntu stable 21 no

Unit Workload Agent Machine Public address Ports Message
nagios/0* active idle 0/lxd/0 192.168.28.48 80/tcp ready
ubuntu-focal/0* active idle 0/lxd/1 192.168.28.81
  nrpe-old/0* active idle 192.168.28.81 icmp,5666/tcp Ready
ubuntu/0* active idle 0 192.168.24.237
  nrpe/0* active idle 192.168.24.237 icmp,5666/tcp Ready

Machine State Address Inst id Series AZ Message
0 started 192.168.24.237 R330 jammy default Deployed
0/lxd/0 started 192.168.28.48 juju-4ef8b9-0-lxd-0 bionic default Container started
0/lxd/1 started 192.168.28.81 juju-4ef8b9-0-lxd-1 focal default Container started
          ...

Read more...

Revision history for this message
Mert Kirpici (mertkirpici) wrote :

Thanks for the swift and detailed confirmation! This change will land to latest/stable in the next release cycle

Changed in charm-nrpe:
milestone: none → 23.04
Revision history for this message
Pedro Castillo (peterctl) wrote :

From ~marcusboden on a different thread:

> To anyone who needs a quick fix immediately (can't wait for an upgrade, or can't upgrade), the following will fix it:

juju run -a nrpe -- sed -i 's/services.manager.reconfigure_services("nrpe-config")/services.get_manager().reconfigure_services("nrpe-config")/' actions/ack-reboot*

Changed in charm-nrpe:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.