canonical / charm-prometheus-libvirt-exporter

A charm that provides per-domain metrics related to CPU, memory, disk and network usage using libvirt exporter.
0 stars 2 forks source link

functional tests failing in master branch (76ea4a46) #18

Closed jneo8 closed 9 months ago

jneo8 commented 9 months ago

I executed the functional test (make functional) of commit 76ea4a46 (16th Dez 2021) and they fail with: zaza.model.UnitError: Units prometheus-libvirt-exporter/0 in error state

The debug logs show that there is an error that is potentially caused by some of more recent changes:

unit-prometheus-libvirt-exporter-0: 17:55:20 ERROR unit.prometheus-libvirt-exporter/0.juju-log juju-info:0: Hook error: Traceback (most recent call last): File "/var/lib/juju/agents/unit-prometheus-libvirt-exporter-0/.venv/lib/python3.5/site-packages/charms/reactive/init.py", line 74, in main bus.dispatch(restricted=restricted_mode) File "/var/lib/juju/agents/unit-prometheus-libvirt-exporter-0/.venv/lib/python3.5/site-packages/charms/reactive/bus.py", line 390, in dispatch _invoke(other_handlers) File "/var/lib/juju/agents/unit-prometheus-libvirt-exporter-0/.venv/lib/python3.5/site-packages/charms/reactive/bus.py", line 359, in _invoke handler.invoke() File "/var/lib/juju/agents/unit-prometheus-libvirt-exporter-0/.venv/lib/python3.5/site-packages/charms/reactive/bus.py", line 181, in invoke self._action(*args) File "/var/lib/juju/agents/unit-prometheus-libvirt-exporter-0/charm/reactive/prometheus-libvirt-exporter.py", line 46, in install_packages configure_libvirtd_apparmor_local_profile(LIBVIRTD_APPARMOR_LOCAL_PROFILE) File "/var/lib/juju/agents/unit-prometheus-libvirt-exporter-0/charm/reactive/prometheus-libvirt-exporter.py", line 222, in configure_libvirtd_apparmor_local_profile current_profile_lines = open(libvirtd_apparmor_local_profile, "r").readlines() FileNotFoundError: [Errno 2] No such file or directory: '/etc/apparmor.d/local/usr.sbin.libvirtd'

unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined Traceback (most recent call last): unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined File "/var/lib/juju/agents/unit-prometheus-libvirt-exporter-0/charm/hooks/juju-info-relation-joined", line 22, in unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined main() unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined File "/var/lib/juju/agents/unit-prometheus-libvirt-exporter-0/.venv/lib/python3.5/site-packages/charms/reactive/init.py", line 74, in main unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined bus.dispatch(restricted=restricted_mode) unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined File "/var/lib/juju/agents/unit-prometheus-libvirt-exporter-0/.venv/lib/python3.5/site-packages/charms/reactive/bus.py", line 390, in dispatch unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined _invoke(other_handlers) unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined File "/var/lib/juju/agents/unit-prometheus-libvirt-exporter-0/.venv/lib/python3.5/site-packages/charms/reactive/bus.py", line 359, in _invoke unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined handler.invoke() unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined File "/var/lib/juju/agents/unit-prometheus-libvirt-exporter-0/.venv/lib/python3.5/site-packages/charms/reactive/bus.py", line 181, in invoke unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined self._action(*args) unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined File "/var/lib/juju/agents/unit-prometheus-libvirt-exporter-0/charm/reactive/prometheus-libvirt-exporter.py", line 46, in install_packages unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined configure_libvirtd_apparmor_local_profile(LIBVIRTD_APPARMOR_LOCAL_PROFILE) unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined File "/var/lib/juju/agents/unit-prometheus-libvirt-exporter-0/charm/reactive/prometheus-libvirt-exporter.py", line 222, in configure_libvirtd_apparmor_local_profile unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined current_profile_lines = open(libvirtd_apparmor_local_profile, "r").readlines() unit-prometheus-libvirt-exporter-0: 17:55:20 WARNING unit.prometheus-libvirt-exporter/0.juju-info-relation-joined FileNotFoundError: [Errno 2] No such file or directory: '/etc/apparmor.d/local/usr.sbin.libvirtd' unit-prometheus-libvirt-exporter-0: 17:55:21 ERROR juju.worker.uniter.operation hook "juju-info-relation-joined" (via explicit, bespoke hook script) failed: exit status 1 unit-prometheus-libvirt-exporter-0: 17:55:21 INFO juju.worker.uniter awaiting error resolution for "relation-joined" hook

I executed the same tests with an older commit 3f8d9f47 (Jan 2021) and they ran successfully.

The tests where run in an OpenStack Environment (serverstack) with proxy set. Machines where on Xenial. The ubuntu/0 machine where the exporter gets installed does not have libvirt-bin installed and therefor the test is failing. It is probably works without problems on a server where libvirt is installed.


Imported from Launchpad using lp2gh.

jneo8 commented 9 months ago

(by stephanpampel) funtional tests are working now after the merge of https://code.launchpad.net/~peppepetra/charm-prometheus-libvirt-exporter/+git/charm-prometheus-libvirt-exporter/+merge/413662

make sure to run 'make clean' before running new tests