Bug 1785423 - rbd-target-gw hitting a problem with it's metrics endpoint
Summary: rbd-target-gw hitting a problem with it's metrics endpoint
Keywords:
Status: CLOSED DUPLICATE of bug 1779645
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: iSCSI
Version: 4.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: 5.*
Assignee: Mike Christie
QA Contact: Madhavi Kasturi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-19 20:55 UTC by Paul Cuzner
Modified: 2019-12-19 22:02 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-12-19 22:02:16 UTC
Embargoed:


Attachments (Terms of Use)

Description Paul Cuzner 2019-12-19 20:55:52 UTC
Description of problem:
deployed ceph-iscsi as rpm on rhel8 and noticed this in the rbd-target-gw log

Dec 19 15:37:30 rhcs4-2.storage.lab rbd-target-gw[166601]:   File "/usr/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
Dec 19 15:37:30 rhcs4-2.storage.lab rbd-target-gw[166601]:     return self.view_functions[rule.endpoint](**req.view_args)
Dec 19 15:37:30 rhcs4-2.storage.lab rbd-target-gw[166601]:   File "/usr/bin/rbd-target-gw", line 35, in prom_metrics
Dec 19 15:37:30 rhcs4-2.storage.lab rbd-target-gw[166601]:     stats.collect()
Dec 19 15:37:30 rhcs4-2.storage.lab rbd-target-gw[166601]:   File "/usr/lib/python3.6/site-packages/ceph_iscsi_config/metrics.py", line 85, in collect
Dec 19 15:37:30 rhcs4-2.storage.lab rbd-target-gw[166601]:     self._get_tpg()
Dec 19 15:37:30 rhcs4-2.storage.lab rbd-target-gw[166601]:   File "/usr/lib/python3.6/site-packages/ceph_iscsi_config/metrics.py", line 101, in _get_tpg
Dec 19 15:37:30 rhcs4-2.storage.lab rbd-target-gw[166601]:     labels = {"gw_iqn": self._root.targets.next().wwn}
Dec 19 15:37:30 rhcs4-2.storage.lab rbd-target-gw[166601]: AttributeError: 'generator' object has no attribute 'next'

this blocks any metrics collection from the gw daemons


Version-Release number of selected component (if applicable):
ceph-iscsi-3.3-2.el8cp.noarch
rhel 8.0
python 3.6.8

How reproducible:
all the time

Steps to Reproduce:
1. /usr/libexec/platform-python -s establishes a python3 environment
2. install ceph-iscsi as an rpm (not container ceph iscsi)
3. after starting rbd-target-gw check the log

Actual results:
as above

Expected results:
metrics should be available, and the rbd-target-gw log should be free of python exceptions

Additional info:

Comment 1 Mike Christie 2019-12-19 22:01:20 UTC
I'm working on it here

https://bugzilla.redhat.com/show_bug.cgi?id=1779645

For the crash in your trace we just needed to use next() instead of .next().

I am updating the code to support multiple targets too.

Comment 2 Mike Christie 2019-12-19 22:02:16 UTC

*** This bug has been marked as a duplicate of bug 1779645 ***


Note You need to log in before you can comment on or make changes to this bug.