Bug #36318
closed
Python 3 Ceph throws exception when sending via zabbix-sender
Added by Sean Bolding over 5 years ago.
Updated over 4 years ago.
Description
When the Ceph MGR Zabbix is enabled and configured to send to a zabbix server this is what I am seeing in /var/log/ceph/ceph-mgr....
0 mgr[zabbix] Exception when sending: a bytes-like object is required, not 'str'
I looked at the module and it looks like its trying to send string values to the zabbix server. This worked in Ceph Luminous but seems to have broken in Mimic. I'm no Python expert but it seems from what I have been able to research that this is due to Python3.
Was not in the selection list but I'm running target version 13.2.1
- Assignee set to Wido den Hollander
Yes, I'll take a look at this one!
Can you tell me a bit more about the Ceph cluster as I don't see this on my Mimic system.
What OS are you running? Maybe the 'ceph -s' output?
- Status changed from New to Can't reproduce
I am closing this one for now as I have not been able to reproduce it.
Feel free to re-open it should the problem come back
I've had the same error on ceph 14.2.1--463-g99339b576a running on OpenSUSE with python 3.6 installed.
The solution for me was to edit /usr/share/ceph/mgr/zabbix/module.py and change line 40.
Original: proc.stdin.write('{0} ceph.{1} {2}\n'.format(hostname, key, value))
New: proc.stdin.write('{0} ceph.{1} {2}\n'.format(hostname, key, value).encode())
I hope this helps someone, maybe this can be fixed in the release? Probably there is a better way of doing it since i'm nog a great python programmer.
- Subject changed from Ceph Mimic now throws exception when sending via zabbix-sender to Python 3 Ceph throws exception when sending via zabbix-sender
- Status changed from Can't reproduce to New
- Target version deleted (
v13.2.3)
- Backport set to nautilus
- Pull request ID set to 28624
- Status changed from New to Fix Under Review
- Priority changed from Normal to Urgent
This is becoming more urgent - we have Python 3 users reporting that they are affected by this bug.
- Status changed from Fix Under Review to Pending Backport
- Assignee changed from Wido den Hollander to Nathan Cutler
- Copied to Backport #41509: nautilus: Python 3 Ceph throws exception when sending via zabbix-sender added
- Status changed from Pending Backport to Resolved
While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".
Also available in: Atom
PDF