-next fails to deploy with TypeError: 'str' object is not callable in ceph_client.auth()

Bug #1895531 reported by Nobuto Murata
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Prometheus Ceph Exporter Charm
Fix Released
High
Unassigned

Bug Description

On my test bed and the simplified bundle attached, it always fails to deploy with the following trace.

However, it fails only with -next, not with the stable one.
https://jaas.ai/u/llama-charmers-next/prometheus-ceph-exporter/5

unit-prometheus-ceph-exporter-0: 13:12:12 ERROR unit.prometheus-ceph-exporter/0.juju-log ceph:2: Hook error:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-prometheus-ceph-exporter-0/.venv/lib/python3.6/site-packages/charms/reactive/__init__.py", line 74, in main
    bus.dispatch(restricted=restricted_mode)
  File "/var/lib/juju/agents/unit-prometheus-ceph-exporter-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 390, in dispatch
    _invoke(other_handlers)
  File "/var/lib/juju/agents/unit-prometheus-ceph-exporter-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 359, in _invoke
    handler.invoke()
  File "/var/lib/juju/agents/unit-prometheus-ceph-exporter-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 181, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-prometheus-ceph-exporter-0/charm/reactive/prometheus_ceph_exporter.py", line 92, in configure_exporter
    "auth_supported": ceph_client.auth(),
TypeError: 'str' object is not callable

Revision history for this message
Nobuto Murata (nobuto) wrote :

A reproducible and minimal bundle.

Revision history for this message
Nobuto Murata (nobuto) wrote :
Revision history for this message
Nobuto Murata (nobuto) wrote :

fwiw, this is the relation data, not all units have the cephx key.

$ juju run --unit prometheus-ceph-exporter/0 -- relation-ids ceph
ceph:2

$ juju run --unit prometheus-ceph-exporter/0 -- relation-list -r ceph:2
ceph-mon/0
ceph-mon/1
ceph-mon/2

$ juju run --unit prometheus-ceph-exporter/0 -- relation-get -r ceph:2 - ceph-mon/0
auth: cephx
ceph-public-address: 192.168.151.145
egress-subnets: 192.168.151.145/32
ingress-address: 192.168.151.145
key: AQAEZl9faCBNKxAAlcglcknpLjd6ZK/EyESp5g==
private-address: 192.168.151.145

$ juju run --unit prometheus-ceph-exporter/0 -- relation-get -r ceph:2 - ceph-mon/1
egress-subnets: 192.168.151.146/32
ingress-address: 192.168.151.146
private-address: 192.168.151.146

$ juju run --unit prometheus-ceph-exporter/0 -- relation-get -r ceph:2 - ceph-mon/2
egress-subnets: 192.168.151.144/32
ingress-address: 192.168.151.144
private-address: 192.168.151.144

Revision history for this message
Jonathan Coleman (velmeran) wrote :

I fixed this by editing /var/lib/juju/agents/unit-prometheus-ceph-exporter-0/charm/reactive/prometheus_ceph_exporter.py

and changing:

ceph_client.auth() -> ceph_client.auth (only one instance)

str(ceph_client.key()) -> ceph_client.key (four instances)

Then restarting jujud-unit-prometheus-ceph-exporter-0.service

Revision history for this message
Hybrid512 (walid-moghrabi) wrote :

Bug and workaround from https://bugs.launchpad.net/charm-prometheus-ceph-exporter/+bug/1895531/comments/4 both confirmed.
This is annoying because -next is way more advanced than stable one :/

Revision history for this message
Jose Guedez (jfguedez) wrote :
Changed in charm-prometheus-ceph-exporter:
status: New → Fix Committed
importance: Undecided → High
Jose Guedez (jfguedez)
Changed in charm-prometheus-ceph-exporter:
status: Fix Committed → Fix Released
milestone: none → 21.01
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.