# Versions
juju 2.3.4
MAAS 2.1.3
ceph-osd rev. 241 and 261
# Issue
After upgrading from rev. 241 to 261 in of our deployments, one of many ceph-osd units ended up with a hook failure:
INFO juju-log upgrade position: None
DEBUG config-changed Traceback (most recent call last):
DEBUG config-changed File "/var/lib/juju/agents/unit-ceph-osd-7/charm/hooks/config-changed", line 562, in <module>
DEBUG config-changed hooks.execute(sys.argv)
DEBUG config-changed File "/var/lib/juju/agents/unit-ceph-osd-7/charm/hooks/charmhelpers/core/hookenv.py", line 800, in execute
DEBUG config-changed self._hooks[hook_name]()
DEBUG config-changed File "/var/lib/juju/agents/unit-ceph-osd-7/charm/hooks/charmhelpers/contrib/hardening/harden.py", line 79, in _harden_inner2
DEBUG config-changed return f(*args, **kwargs)
DEBUG config-changed File "/var/lib/juju/agents/unit-ceph-osd-7/charm/hooks/config-changed", line 351, in config_changed
DEBUG config-changed check_for_upgrade()
DEBUG config-changed File "/var/lib/juju/agents/unit-ceph-osd-7/charm/hooks/config-changed", line 118, in check_for_upgrade
DEBUG config-changed upgrade_key='osd-upgrade')
DEBUG config-changed File "lib/ceph/utils.py", line 1924, in roll_osd_cluster
DEBUG config-changed osd_sorted_list[position - 1].name))
DEBUG config-changed TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'
# Logs
Excerpt from unit-ceph-osd.log: https://pastebin.com/wKi53b31
Haven't checked the code but here are the OSDs from `lsblk`: https://pastebin.com/eHMYk96z
So the problem is in this function in lib/ceph/utils.py:
def get_upgrade_ position( osd_sorted_ list, match_name):
"""Return the upgrade position for the given osd.
:param osd_sorted_list: list. Osds sorted osd_sorted_ list):
:param match_name: str. The osd name to match
:returns: int. The position or None if not found
"""
for index, item in enumerate(
if item.name == match_name:
return index
return None
It returns None. In "roll_osd_ cluster( )" function, it needs to check for the return value of None and pick the right thing to do which is raise an error, as it should be blocked.