Description of problem: There is an error in parsing arguments of command nfsdclnts. # nfsdclnts --hostname | head Inode number | Type | Access | Deny | Hostname | Filename 6996086 | open | r- | -- | myhostname | N/A 6996086 | deleg | r | | myhostname | N/A 8417871 | deleg | r | | myhostname | N/A 8417903 | deleg | r | | myhostname | N/A 8417870 | deleg | r | | myhostname | N/A 8417882 | deleg | r | | myhostname | N/A 8417889 | deleg | r | | myhostname | N/A 8417883 | deleg | r | | myhostname | N/A 7136342 | deleg | r | | myhostname | N/A Traceback (most recent call last): File "/usr/sbin/nfsdclnts", line 254, in <module> nfsd4_show() File "/usr/sbin/nfsdclnts", line 246, in nfsd4_show printer(item, args) File "/usr/sbin/nfsdclnts", line 150, in printer print('%-22s' %hostname, end='| ') BrokenPipeError: [Errno 32] Broken pipe Version-Release number of selected component (if applicable): nfs-utils-2.5.1-2.rc3.fc32.x86_64 How reproducible: Always Steps to Reproduce: 1. nfsdclnts --hostname | head Actual results: Normal output, and Traceback Expected results: Normal output
I'm not seeing this happening in later releases... Could you please verify?
I have tested it on a server with nfs-utils-2.5.1-4.rc4.fc32.x86_64 installed. The error (with slightly changed line numbers) still occurs. The server currently runs with kernel 5.8.10-200.fc32.x86_64, I can reboot to a newer kernel and retest if you think it matters. # nfsdclnts --hostname | head Inode number | Type | Access | Deny | Hostname | Filename 17828777 | open | rw | -- | myhostname | e5c00bcb8e064227a528a9fb14707571-device-volumes.tdb 17828979 | open | rw | -- | myhostname | e5c00bcb8e064227a528a9fb14707571-stream-volumes.tdb 17828981 | open | rw | -- | myhostname | e5c00bcb8e064227a528a9fb14707571-card-database.tdb 17956871 | open | rw | -- | myhostname | index 17825840 | open | r- | -- | myhostname | .nfs00000000011000300000013b 17826013 | open | rw | -- | myhostname | contacts.db 17833398 | open | r- | -- | myhostname | cert9.db 17833398 | deleg | r | | myhostname | cert9.db 17833402 | open | r- | -- | myhostname | key4.db Traceback (most recent call last): File "/usr/sbin/nfsdclnts", line 254, in <module> nfsd4_show() File "/usr/sbin/nfsdclnts", line 246, in nfsd4_show printer(item, args) File "/usr/sbin/nfsdclnts", line 156, in printer print(fname) BrokenPipeError: [Errno 32] Broken pipe
I am able to reproduce the issue by passing a large states file which would take considerable amount of time to process. The head binary will close the pipe as soon it has received 10 lines or enough data to process, which would case this issue. # nfsdclnts -f `pwd`/states --hostname | head Inode number | Type | Access | Deny | Hostname | Filename 201352297 | open | rw | -- | linux22passion | nfstest 201352297 | lock | | | linux22passion | nfstest 201352297 | open | rw | -- | linux22passion | nfstest 201352297 | lock | | | linux22passion | nfstest 201352297 | open | rw | -- | linux22passion | nfstest 201352297 | lock | | | linux22passion | nfstest 201352297 | open | rw | -- | linux22passion | nfstest 201352297 | lock | | | linux22passion | nfstest 201352297 | open | rw | -- | linux22passion | nfstest Traceback (most recent call last): File "/usr/sbin/nfsdclnts", line 254, in <module> nfsd4_show() File "/usr/sbin/nfsdclnts", line 246, in nfsd4_show printer(item, args) File "/usr/sbin/nfsdclnts", line 150, in printer print('%-22s' %hostname, end='| ') BrokenPipeError: [Errno 32] Broken pipe The below patch should fix the issue, as most python binaries follow similar approach, example dnf. With this patch we ignore SIGPIPE signal. # git diff diff --git a/tools/nfsdclnts/nfsdclnts.py b/tools/nfsdclnts/nfsdclnts.py index 5e7e03c2..b7280f2c 100755 --- a/tools/nfsdclnts/nfsdclnts.py +++ b/tools/nfsdclnts/nfsdclnts.py @@ -223,6 +223,7 @@ def nfsd4_show(): global verbose verbose = False + signal.signal(signal.SIGPIPE, signal.SIG_DFL) if args.verbose: verbose = True With patch: # ./nfsdclnts.py -f `pwd`/states --hostname | head Inode number | Type | Access | Deny | Hostname | Filename 201352297 | open | rw | -- | linux22passion | nfstest 201352297 | lock | | | linux22passion | nfstest 201352297 | open | rw | -- | linux22passion | nfstest 201352297 | lock | | | linux22passion | nfstest 201352297 | open | rw | -- | linux22passion | nfstest 201352297 | lock | | | linux22passion | nfstest 201352297 | open | rw | -- | linux22passion | nfstest 201352297 | lock | | | linux22passion | nfstest 201352297 | open | rw | -- | linux22passion | nfstest Will soon send the patch upstream for review.
Created attachment 1761584 [details] nfsdclnts: Ignore SIGPIPE signal
FEDORA-2021-d191e54a3c has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2021-d191e54a3c
FEDORA-2021-e31a53a752 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-e31a53a752
FEDORA-2021-e31a53a752 has been pushed to the Fedora 34 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-e31a53a752` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-e31a53a752 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-304625fe43 has been pushed to the Fedora 33 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-304625fe43` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-304625fe43 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-d191e54a3c has been pushed to the Fedora 32 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-d191e54a3c` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-d191e54a3c See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-304625fe43 has been pushed to the Fedora 33 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2021-e31a53a752 has been pushed to the Fedora 34 stable repository. If problem still persists, please make note of it in this bug report.
Thanks for the update. It fixes the bug.
FEDORA-2021-d191e54a3c has been pushed to the Fedora 32 stable repository. If problem still persists, please make note of it in this bug report.