gwcli error - ZeroDivisionError: float division by zero
Hi, I am scratching my head to figure out what could be the issue:
[root@iscsi-gw-test1 RPMS]# gwcli -d
Adding ceph cluster 'ceph' to the UI
Refreshing disk information from the config object
Refreshing gateway & client information
Gathering pool stats for 'ceph'
Traceback (most recent call last):
File "/usr/bin/gwcli", line 185, in
This is a new iscsi-gw fresh install, "rbd" pool was cleaned up of all objects before. The object gateway.conf is created in poll "rbd" but i just can't get gwcli working...
Hi. Issue has been sorted out, it was a ceph pool with a crush rule assigned that did not have any osds in its root crush tree at the moment. This determined a value of max_bytes 0.
Makes sense - we should catch the error though and not barf! I'll raise a PR to fix
This is a possible patch:
diff -ruN ceph_iscsi-3.2-py3.7.egg.orig/gwcli/ceph.py ceph_iscsi-3.2-py3.7.egg/gwcli/ceph.py
--- ceph_iscsi-3.2-py3.7.egg.orig/gwcli/ceph.py 2019-09-08 09:47:40.000000000 +0200
+++ ceph_iscsi-3.2-py3.7.egg/gwcli/ceph.py 2020-03-05 17:33:59.351690142 +0100
@@ -306,6 +306,11 @@
self.max_bytes = pool_metadata['stats']['max_avail']
self.used_bytes = pool_metadata['stats']['bytes_used']
+ if self.max_bytes == 0:
+ if pool_metadata['stats']['percent_used'] != 0:
+ size_mb = self.used_bytes / pool_metadata['stats']['percent_used']
+ self.max_bytes = size_mb - self.used_bytes
+
self._calc_overcommit()
def summary(self):
@gurubert
Are you still hitting this bug? It should be fixed. We have a check for max_bytes=0 in calc_overcommit().
@gurubert
Are you still hitting this bug? It should be fixed. We have a check for max_bytes=0 in calc_overcommit().
Yes, I updated my Fedora 30 boxes and got gwcli 2.7
Are you using gwcli from ceph-iscsi-cli or ceph-iscsi?
Where are you getting the rpm from? From the distro repo or download.ceph.com or somewhere else?
ceph-iscsi-cli is no longer being developed. We have done some releases for critical bug fixes only. It was merged with ceph-iscsi-config in the ceph-iscsi repo, and the package is named ceph-iscsi.
If you are using ceph-iscsi-cli is it because you are using ceph-ansible still?
OK, please ignore that. I just found out that ceph-iscsi was installed from an older git checkout.