During a fresh deployment, the default dashboard zip file is malformatted

Bug #1933870 reported by Garrett Neugent
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Prometheus libvirt exporter charm
New
Undecided
Unassigned

Bug Description

When adding the prometheus-libvirt-exporter charm to a customer cloud, we found that the default dashboard zip file was not being zipped correctly. Looking at an example unit log, one can see the failure during the install hook:

tracer: set flag libvirt-exporter.started
tracer: -- dequeue handler reactive/prometheus-libvirt-exporter.py:34:install_packages
tracer: -- dequeue handler reactive/prometheus-libvirt-exporter.py:59:start_snap
2021-06-28 15:53:30 INFO juju-log juju-info:483: start_snap() libvirt-exporter.started
2021-06-28 15:53:30 DEBUG juju-log juju-info:483: Installing dashboards from resource
2021-06-28 15:53:31 ERROR juju-log juju-info:483: BadZipFile: File is not a zip file

Investigating the files themselves, one can see:

ubuntu@REDACTED:/var/lib/juju/agents/unit-prometheus-libvirt-exporter-3/resources/dashboards$ sudo zcat grafana-dashboards.zip

gzip: grafana-dashboards.zip: unexpected end of file

and

ubuntu@REDACTED:/var/lib/juju/agents/unit-prometheus-libvirt-exporter-3/charm/files/grafana-dashboards$ sudo zcat grafana-dashboards.zip

gzip: grafana-dashboards.zip: unexpected end of file

Commands to deploy the charm:

juju deploy prometheus-libvirt-exporter
juju relate prometheus-libvirt-exporter nova-compute-kvm
juju relate prometheus-libvirt-exporter:scrape prometheus:target
juju relate prometheus-libvirt-exporter:dashboards grafana:dashboards
juju relate prometheus-libvirt-exporter:nrpe-external-master nrpe-host:nrpe-external-master

Charm info:

  prometheus:
    charm: cs:prometheus2-19
    series: bionic
    os: ubuntu
    charm-origin: jujucharms
    charm-name: prometheus2
    charm-rev: 19
    charm-version: ae30894
    can-upgrade-to: cs:prometheus2-22
    exposed: false
    application-status:
      current: active
      message: Ready
      since: 28 Jun 2021 15:59:41Z
    relations:
      grafana-source:
      - grafana
      juju-info:
      - canonical-livepatch
      - filebeat
      - landscape-client
      - logrotate
      - ntp
      - telegraf-prometheus
      nrpe-external-master:
      - nrpe-host
      target:
      - prometheus-ceph-exporter
      - prometheus-libvirt-exporter
      - prometheus-openstack-exporter
      - telegraf
      - telegraf-maas-infra
      - telegraf-prometheus

$ juju config keystone openstack-origin
cloud:bionic-ussuri

As a workaround, reattaching the dashboard solved this issue:

1) clone the libvirt.json file on the cloud in question
2) zip grafana-dashboards.zip libvirt.json
3) juju attach-resource prometheus-libvirt-exporter dashboards=./grafana-dashboards.zip

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.