mon-relation-changed IndexError: list index out of range
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceph OSD Charm |
Fix Released
|
High
|
David Ames | ||
charms.ceph |
New
|
Undecided
|
Unassigned |
Bug Description
Fresh install of a ceph node with some disks reused from a previous ceph installation. Cleared lvs infomration on disks and the zap and add. In ceph everything is ok, but juju complains with:
2019-03-10 22:33:49 DEBUG mon-relation-
2019-03-10 22:33:49 DEBUG mon-relation-
2019-03-10 22:33:49 DEBUG mon-relation-
2019-03-10 22:33:49 DEBUG mon-relation-
2019-03-10 22:33:49 DEBUG mon-relation-
2019-03-10 22:33:49 DEBUG mon-relation-
2019-03-10 22:33:49 DEBUG mon-relation-
2019-03-10 22:33:49 DEBUG mon-relation-
2019-03-10 22:33:49 DEBUG mon-relation-
2019-03-10 22:33:49 DEBUG mon-relation-
2019-03-10 22:33:49 DEBUG mon-relation-
2019-03-10 22:33:49 DEBUG mon-relation-
2019-03-10 22:33:49 DEBUG mon-relation-
2019-03-10 22:33:49 DEBUG mon-relation-
2019-03-10 22:33:49 ERROR juju.worker.
A little dig further reveals that the function list_logical_
lvs --options lv_name --noheadings
which returns:
osd-block-
osd-block-
osd-block-
osd-block-
osd-block-
osd-block-
osd-block-
osd-block-
osd-block-
osd-block-
osd-block-
osd-wal-
osd-wal-
osd-wal-
osd-wal-
osd-wal-
osd-wal-
osd-wal-
osd-wal-
osd-wal-
osd-wal-
osd-wal-
lvroot
As a temporary workaround I edited hooks/charmhelp
124c124
< lvs = []
---
> lvs = ['']
This way the failed hook continued and everything seems to be working as expected
Changed in charm-ceph-osd: | |
status: | Fix Committed → Fix Released |
TRIAGE:
In is_active_ bluestore_ device call to check the return value of list_logical_ volumes before attempting to get the zeroth value from the list.
diff --git a/lib/ceph/utils.py b/lib/ceph/utils.py bluestore_ device( dev):
index 35f351f..220039b 100644
--- a/lib/ceph/utils.py
+++ b/lib/ceph/utils.py
@@ -1692,7 +1692,11 @@ def is_active_
return False
vg_name = lvm.list_ lvm_volume_ group(dev) logical_ volumes( 'vg_name= {}'.format( vg_name) )[0] logical_ volumes( 'vg_name= {}'.format( vg_name) )
- lv_name = lvm.list_
+ logical_volumes = lvm.list_
+ if logical_volumes:
+ lv_name = logical_volumes[0]
+ else:
+ return False