Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2150889

Summary: wrong client.xprt.srcport in /usr/libexec/pcp/pmdas/nfsclient/pmdanfsclient.python
Product: Red Hat Enterprise Linux 8 Reporter: Lukas Herbolt <lherbolt>
Component: pcpAssignee: Nathan Scott <nathans>
Status: CLOSED ERRATA QA Contact: Jan Kurik <jkurik>
Severity: medium Docs Contact: Jacob Taylor Valdez <jvaldez>
Priority: unspecified    
Version: 8.7CC: jkurik, nathans, scox
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: 8.9Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pcp-5.3.7-17.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-14 15:25:39 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 Lukas Herbolt 2022-12-05 14:37:41 UTC
Description of problem:
Getting errors in /var/log/pcp/pmcd/nfsclient.log

Traceback (most recent call last):
  File "/var/lib/pcp/pmdas/nfsclient/pmdanfsclient.python", line 666, in nfsclient_fetch
    self.nfsclient_refresh()
  File "/var/lib/pcp/pmdas/nfsclient/pmdanfsclient.python", line 599, in nfsclient_refresh
    client.xprt.srcport = values[1]
TypeError: bytes or integer address expected instead of str instance
Traceback (most recent call last):
  File "/var/lib/pcp/pmdas/nfsclient/pmdanfsclient.python", line 666, in nfsclient_fetch
    self.nfsclient_refresh()
  File "/var/lib/pcp/pmdas/nfsclient/pmdanfsclient.python", line 599, in nfsclient_refresh
    client.xprt.srcport = values[1]
TypeError: bytes or integer address expected instead of str instance
Traceback (most recent call last):
  File "/var/lib/pcp/pmdas/nfsclient/pmdanfsclient.python", line 666, in nfsclient_fetch
    self.nfsclient_refresh()
  File "/var/lib/pcp/pmdas/nfsclient/pmdanfsclient.python", line 599, in nfsclient_refresh
    client.xprt.srcport = values[1]


Version-Release number of selected component (if applicable):
pcp-pmda-nfsclient-5.3.7-7.el8.x86_64

How reproducible:
everytime

Steps to Reproduce:
1. install pmda
2. mount rdma nfs
3. check the stats

Actual results:
above error

Expected results:
values are logged

Additional info:
Fix:
[lherbolt@trufa ~]Φ less Downloads/diff 
--- pmdanfsclient.python.orig   2022-12-02 12:05:43.533711411 -0500
+++ pmdanfsclient.python        2022-12-02 12:02:20.299097718 -0500
@@ -585,7 +585,7 @@
                         client.xprt.sending_u = self.longs(values[12])
                         client.xprt.pending_u = self.longs(values[13])
                     elif xprt_prot == 'udp':
-                        client.xprt.srcport = values[1]
+                        client.xprt.srcport = self.chars(values[1])
                         client.xprt.bind_count = self.longs(values[2])
                         client.xprt.sends = self.longs(values[3])
                         client.xprt.recvs = self.longs(values[4])
@@ -596,7 +596,7 @@
                         client.xprt.sending_u = self.longs(values[9])
                         client.xprt.pending_u = self.longs(values[10])
                     elif xprt_prot == 'rdma':
-                        client.xprt.srcport = values[1]
+                        client.xprt.srcport = self.chars(values[1])
                         client.xprt.bind_count = self.longs(values[2])
                         client.xprt.connect_count = self.longs(values[3])
                         client.xprt.connect_time = self.longs(values[4])

Comment 1 Nathan Scott 2022-12-05 20:45:40 UTC
Thanks for the report and patch Lukas, much appreciated!

Could you attach a copy of an affected /proc/self/mountstats file please?  I'll use it to make an automated regression test - we clearly have a gap in our test coverage here.

cheers.

Comment 14 errata-xmlrpc 2023-11-14 15:25:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (pcp bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6910