Bug 2150889 - wrong client.xprt.srcport in /usr/libexec/pcp/pmdas/nfsclient/pmdanfsclient.python
Summary: wrong client.xprt.srcport in /usr/libexec/pcp/pmdas/nfsclient/pmdanfsclient.p...
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pcp
Version: 8.7
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: 8.9
Assignee: Nathan Scott
QA Contact: Jan Kurik
Jacob Taylor Valdez
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-12-05 14:37 UTC by Lukas Herbolt
Modified: 2023-06-26 15:49 UTC (History)
3 users (show)

Fixed In Version: pcp-5.3.7-17.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-141313 0 None None None 2022-12-05 15:02:59 UTC

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.


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