Project

General

Profile

Actions

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.

Status:
Resolved
Priority:
Urgent
Assignee:
Category:
zabbix module
Target version:
-
% Done:

0%

Source:
Community (user)
Tags:
Backport:
nautilus
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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


Related issues 1 (0 open1 closed)

Copied to mgr - Backport #41509: nautilus: Python 3 Ceph throws exception when sending via zabbix-senderResolvedNathan CutlerActions
Actions #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?

Actions #2

Updated by Wido den Hollander over 5 years ago

Yes, I'll take a look at this one!

Actions #3

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?

Actions #4

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

Actions #5

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.

Actions #6

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
Actions #7

Updated by Nathan Cutler almost 5 years ago

  • Pull request ID set to 28624
Actions #8

Updated by Nathan Cutler almost 5 years ago

  • Status changed from New to Fix Under Review
Actions #9

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.

Actions #10

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
Actions #11

Updated by Nathan Cutler over 4 years ago

  • Copied to Backport #41509: nautilus: Python 3 Ceph throws exception when sending via zabbix-sender added
Actions #12

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".

Actions

Also available in: Atom PDF