infinite loop @install if chrony package is installed

Bug #2060180 reported by Arnault MICHEL
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceph Monitor Charm
Triaged
Critical
Unassigned

Bug Description

Hi,

As ntp sync is really important for CEPH, we try to add the ntp service for every openstack component with :

model-config.yaml file containing :

```yaml
cloudinit-userdata: |
  ntp:
    enabled: true
    ntp_client: chrony
    timezone: Europe/Paris
    servers:
      - DNSserverIP
  package_update: true
  package_upgrade: true
...
```

Then `juju add-model --controller my-jujuctrl --config ./openstack/model-config.yaml openstack my-maas-cloud-provider`

The charm try to uninstall chrony but it raise a python error / exception @ https://opendev.org/openstack/charm-ceph-mon/src/branch/master/src/charm.py#L77
complaining about the "packages" parameter, and provide an infinite loop on the install step of the charm.

juju logs :
2024-04-03 17:44:01 INFO unit.ceph-mon/1.juju-log server.go:325 Installing ['ceph', 'gdisk', 'radosgw', 'lvm2', 'parted', 'smartmontools'] with options: ['--option=Dpkg::Options::=--force-confold']
2024-04-03 17:44:02 INFO unit.ceph-mon/1.juju-log server.go:325 Updating status
2024-04-03 17:44:02 ERROR unit.ceph-mon/1.juju-log server.go:325 Uncaught exception while in charm code:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-ceph-mon-1/charm/./src/charm.py", line 317, in <module>
    main(CephMonCharm)
  File "/var/lib/juju/agents/unit-ceph-mon-1/charm/venv/ops/main.py", line 544, in main
    manager.run()
  File "/var/lib/juju/agents/unit-ceph-mon-1/charm/venv/ops/main.py", line 520, in run
    self._emit()
  File "/var/lib/juju/agents/unit-ceph-mon-1/charm/venv/ops/main.py", line 506, in _emit
    self.framework.reemit()
  File "/var/lib/juju/agents/unit-ceph-mon-1/charm/venv/ops/framework.py", line 861, in reemit
    self._reemit()
  File "/var/lib/juju/agents/unit-ceph-mon-1/charm/venv/ops/framework.py", line 941, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-ceph-mon-1/charm/./src/charm.py", line 75, in on_install
    apt.remove_package(packages=rm_packages, fatal=True)
TypeError: remove_package() got an unexpected keyword argument 'packages'

I solved the problem on our server with a manual uninstall :
juju ssh ceph-mon/0 sudo apt remove chrony -y
juju ssh ceph-mon/1 sudo apt remove chrony -y
juju ssh ceph-mon/2 sudo apt remove chrony -y

Our charm setting is :
  ceph-mon:
    charm: ceph-mon
    channel: quincy/stable
    revision: 204
    resources:
      alert-rules: 3
    num_units: 3
    to:
    - lxd:6
    - lxd:7
    - lxd:8
    options:
      expected-osd-count: 3
      monitor-count: 3
      source: distro

Arnault MICHEL (mitchor)
description: updated
Revision history for this message
Billy Olsen (billy-olsen) wrote :

The referenced function is incorrect. It should be using this function signature https://opendev.org/openstack/charm-ceph-mon/src/branch/master/lib/charms/operator_libs_linux/v0/apt.py#L805 and looks like fallout from the migration to operator charm.

Changed in charm-ceph-mon:
status: New → Triaged
importance: Undecided → Critical
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.