Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
This project is now read‑only. Starting Monday, February 2, please use https://ibm-ceph.atlassian.net/ for all bug tracking management.

Bug 1785423

Summary: rbd-target-gw hitting a problem with it's metrics endpoint
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Paul Cuzner <pcuzner>
Component: iSCSIAssignee: Mike Christie <mchristi>
Status: CLOSED DUPLICATE QA Contact: Madhavi Kasturi <mkasturi>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.0CC: ceph-eng-bugs, ceph-qe-bugs
Target Milestone: rc   
Target Release: 5.*   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-12-19 22:02:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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 ***