mgr/balancer: 'dict_keys' object does not support indexing
There is a python3 compatibility issue for balancer module running in crush-compat mode:
# ceph config-key dump | grep balancer "config-history/4/+mgr/mgr/balancer/mode": "crush-compat", "config-history/5/+mgr/mgr/balancer/active": "true", "config/mgr/mgr/balancer/active": "true", "config/mgr/mgr/balancer/mode": "crush-compat", # ceph balancer status Error EIO: Module 'balancer' has experienced an error and cannot handle commands: 'dict_keys' object
It has been reported for 14.2.2 but I believe it is present in the master too.
#3 Updated by Eugen Block almost 2 years ago
Is there anything I can temporarily do to get rid of the HEALTH_ERR status? I noticed that our crushmap still had some straw entries and executed ceph osd crush set-all-straw-buckets-to-straw2
After that the cluster went in error status:
ceph01:~ # ceph -s cluster: id: 655cb05a-435a-41ba-83d9-8549f7c36167 health: HEALTH_ERR Module 'balancer' has failed: 'dict_keys' object does not support indexing
Looking into MGR logs I find this message occuring every minute:
mgr[balancer] Error creating compat weight-set
I hadn't noticed that message before running set-all-straw-buckets-to-straw2. Obviously, balancer module can't be disabled, so I'm stuck with the error status.
#7 Updated by Eugen Block almost 2 years ago
Eugen Block wrote:
Is there anything I can temporarily do to get rid of the HEALTH_ERR status?
For a temporary solution I applied the proposed change to /usr/share/ceph/mgr/balancer/module.py on the active MGR and restarted it. The balancer is currently remapping PGs, so it seems to work now. Also the set-all-straw-buckets-to-straw2 was successful.