check_rabbitmq_queues.py results in TypeError

Bug #1804349 reported by Xav Paice
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack RabbitMQ Server Charm
Fix Released
High
Unassigned

Bug Description

On upgrade to cs:rabbitmq-server-83 (from -82, and from 18.08), the nrpe check check_rabbitmq_queues.py returns a traceback:

/usr/local/lib/nagios/plugins/check_rabbitmq_queues.py -c \* \* 500 600 /var/lib/rabbitmq/data/juju-8ea30b-0-lxd-20_queue_stats.dat
Traceback (most recent call last):
  File "/usr/local/lib/nagios/plugins/check_rabbitmq_queues.py", line 91, in <module>
    stats_collated = collate_stats(stats, args.c)
  File "/usr/local/lib/nagios/plugins/check_rabbitmq_queues.py", line 38, in collate_stats
    for vhost, queue, m_all in stats:
  File "/usr/local/lib/nagios/plugins/check_rabbitmq_queues.py", line 22, in gen_stats
    for line in data_lines:
  File "/usr/local/lib/nagios/plugins/check_rabbitmq_queues.py", line 17, in gen_data_lines
    if not line.startswith("#"):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

Well, that's embarrassing. I missed that on the last bug fix. Sadly we have no check for this; we probably need to think about how to improve it.

Changed in charm-rabbitmq-server:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Alex Kavanagh (ajkavanagh)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-rabbitmq-server (master)

Fix proposed to branch: master
Review: https://review.openstack.org/619227

Changed in charm-rabbitmq-server:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-rabbitmq-server (master)

Reviewed: https://review.openstack.org/619227
Committed: https://git.openstack.org/cgit/openstack/charm-rabbitmq-server/commit/?id=065914d696ffb39c77696925b55b9795147cae00
Submitter: Zuul
Branch: master

commit 065914d696ffb39c77696925b55b9795147cae00
Author: Alex Kavanagh <email address hidden>
Date: Wed Nov 21 12:32:36 2018 +0000

    Fix more PY3 issues in check_rabbitmq_queues.py

    Note that, for PY3, the unbuffered IO in the check_rabbitmq.py script
    has to be switched off as PY3 doesn't support unbuffered IO for text
    (think str) rather than binary byte streams.

    Change-Id: I79af54cdbd7381f88732b24f65e94451350b9ab9
    Closes-Bug: #1804349
    Closes-Bug: #1804348

Changed in charm-rabbitmq-server:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-rabbitmq-server (stable/18.11)

Fix proposed to branch: stable/18.11
Review: https://review.openstack.org/619564

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-rabbitmq-server (stable/18.11)

Reviewed: https://review.openstack.org/619564
Committed: https://git.openstack.org/cgit/openstack/charm-rabbitmq-server/commit/?id=0a8455b0dfd07c017ed2d196c2ac73d68262c5df
Submitter: Zuul
Branch: stable/18.11

commit 0a8455b0dfd07c017ed2d196c2ac73d68262c5df
Author: Alex Kavanagh <email address hidden>
Date: Wed Nov 21 12:32:36 2018 +0000

    Fix more PY3 issues in check_rabbitmq_queues.py

    Note that, for PY3, the unbuffered IO in the check_rabbitmq.py script
    has to be switched off as PY3 doesn't support unbuffered IO for text
    (think str) rather than binary byte streams.

    Closes-Bug: #1804349
    Closes-Bug: #1804348
    (cherry picked from commit 065914d696ffb39c77696925b55b9795147cae00)

    Change-Id: I928c2e30d0025d0d1901dd85051e8e72dcd21a07

James Page (james-page)
Changed in charm-rabbitmq-server:
milestone: none → 18.11
Changed in charm-rabbitmq-server:
assignee: Alex Kavanagh (ajkavanagh) → nobody
Changed in charm-rabbitmq-server:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.