Bug #36318
closedPython 3 Ceph throws exception when sending via zabbix-sender
0%
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
Updated by Lenz Grimmer over 5 years ago
- Assignee set to Wido den Hollander
@Wido den Hollander, would you mind taking a look at this?
Updated by Wido den Hollander over 5 years ago
Yes, I'll take a look at this one!
Updated by Wido den Hollander over 5 years ago
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?
Updated by Wido den Hollander over 5 years ago
- 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
Updated by Jochem Kuijpers almost 5 years ago
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.
Updated by Nathan Cutler almost 5 years ago
- 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
Updated by Nathan Cutler almost 5 years ago
- Status changed from New to Fix Under Review
Updated by Nathan Cutler almost 5 years ago
- Priority changed from Normal to Urgent
This is becoming more urgent - we have Python 3 users reporting that they are affected by this bug.
Updated by Sebastian Wagner over 4 years ago
- Status changed from Fix Under Review to Pending Backport
- Assignee changed from Wido den Hollander to Nathan Cutler
Updated by Nathan Cutler over 4 years ago
- Copied to Backport #41509: nautilus: Python 3 Ceph throws exception when sending via zabbix-sender added
Updated by Nathan Cutler over 4 years ago
- 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".