Error when image size data has no value

Bug #1923127 reported by Edin S
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
charm-cloudstats
New
Undecided
Unassigned

Bug Description

While investigating a separate issue, I found the following error message being repeatedly reported in the journal/log:

Traceback (most recent call last):
  File "/snap/cloudstats/x1/bin/cloudstats-exporter", line 33, in <module>
    sys.exit(load_entry_point('cloudstats==0.1', 'console_scripts', 'cloudstats-exporter')())
  File "/snap/cloudstats/x1/lib/python3.6/site-packages/cloudstats/exporter.py", line 54, in main
    daemon.run()
  File "/snap/cloudstats/x1/lib/python3.6/site-packages/cloudstats/exporter.py", line 47, in run
    self.trigger()
  File "/snap/cloudstats/x1/lib/python3.6/site-packages/cloudstats/exporter.py", line 38, in trigger
    self.openstack.get_all_stats()
  File "/snap/cloudstats/x1/lib/python3.6/site-packages/cloudstats/opensdk.py", line 230, in get_all_stats
    self._get_image_stats()
  File "/snap/cloudstats/x1/lib/python3.6/site-packages/cloudstats/opensdk.py", line 375, in _get_image_stats
    value=image["size"],
  File "/snap/cloudstats/x1/lib/python3.6/site-packages/cloudstats/opensdk.py", line 286, in _create_or_update_gauge
    self.gauge_dict[gauge_name].labels(**labels).set(value)
  File "/snap/cloudstats/x1/lib/python3.6/site-packages/prometheus_client/metrics.py", line 359, in set
    self._value.set(float(value))
TypeError: float() argument must be a string or a number, not 'NoneType'

Joe Guo (guoqiao)
information type: Proprietary → Public
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.