canonical / cloudstats

GNU General Public License v3.0
1 stars 2 forks source link

Cloudstats fails to collect statistics because image.size is None #2

Open agileshaw opened 1 year ago

agileshaw commented 1 year ago

This is bionic-stein:

Jul 15 10:21:22 juju-a00f9c-31-lxd-1 systemd[1]: Started Service for snap application cloudstats.cloudstats. Jul 15 10:21:26 juju-a00f9c-31-lxd-1 cloudstats.cloudstats[18903]: Traceback (most recent call last): Jul 15 10:21:26 juju-a00f9c-31-lxd-1 cloudstats.cloudstats[18903]: File "/snap/cloudstats/x9/bin/cloudstats", line 11, in Jul 15 10:21:26 juju-a00f9c-31-lxd-1 cloudstats.cloudstats[18903]: load_entry_point('cloudstats==0.1', 'console_scripts', 'cloudstats')() Jul 15 10:21:26 juju-a00f9c-31-lxd-1 cloudstats.cloudstats[18903]: File "/snap/cloudstats/x9/lib/python3.6/site-packages/cloudstats/daemon.py", line 92, in main Jul 15 10:21:26 juju-a00f9c-31-lxd-1 cloudstats.cloudstats[18903]: daemon.run() Jul 15 10:21:26 juju-a00f9c-31-lxd-1 cloudstats.cloudstats[18903]: File "/snap/cloudstats/x9/lib/python3.6/site-packages/cloudstats/daemon.py", line 82, in run Jul 15 10:21:26 juju-a00f9c-31-lxd-1 cloudstats.cloudstats[18903]: data.update(self.collect_openstack_data()) Jul 15 10:21:26 juju-a00f9c-31-lxd-1 cloudstats.cloudstats[18903]: File "/snap/cloudstats/x9/lib/python3.6/site-packages/cloudstats/daemon.py", line 67, in collect_openstack_data Jul 15 10:21:26 juju-a00f9c-31-lxd-1 cloudstats.cloudstats[18903]: stats = self.openstack.get_all_stats() Jul 15 10:21:26 juju-a00f9c-31-lxd-1 cloudstats.cloudstats[18903]: File "/snap/cloudstats/x9/lib/python3.6/site-packages/cloudstats/opensdk.py", line 211, in get_all_stats Jul 15 10:21:26 juju-a00f9c-31-lxd-1 cloudstats.cloudstats[18903]: stats.update(self._get_image_stats()) Jul 15 10:21:26 juju-a00f9c-31-lxd-1 cloudstats.cloudstats[18903]: File "/snap/cloudstats/x9/lib/python3.6/site-packages/cloudstats/opensdk.py", line 367, in _get_image_stats Jul 15 10:21:26 juju-a00f9c-31-lxd-1 cloudstats.cloudstats[18903]: image_size.append(image.size / 1000000) # Convert B->MB Jul 15 10:21:26 juju-a00f9c-31-lxd-1 cloudstats.cloudstats[18903]: TypeError: unsupported operand type(s) for /: 'NoneType' and 'int


Imported from Launchpad using lp2gh.

agileshaw commented 1 year ago

(by peppepetra) This is happening when an image is in status queued and not active.

agileshaw commented 1 year ago

(by addyess) This still occurs with the snap in snapstore cloudstats 1.0 x1 - - - https://pastebin.canonical.com/p/9QR8ZXPnhh/

agileshaw commented 1 year ago

(by addyess) It looks like the fix was committed and merged -- but then accidentally removed during a refactor