Univention Bugzilla – Bug 49972
top/query: NoSuchProcess: psutil.NoSuchProcess process no longer exists (pid=18137)
Last modified: 2020-09-09 16:48:17 CEST
Today the Jenkins test failed: Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/univention/management/console/base.py", line 260, in execute function.__func__(self, request, *args, **kwargs) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 181, in _response return function(self, request) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 321, in _response result = _multi_response(self, request) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 181, in _response return function(self, request) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 443, in _response return list(function(self, iterator, *nones)) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 289, in _fake_func yield function(self, *args) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/top/__init__.py", line 58, in query username = process.username() File "/usr/lib/python2.7/dist-packages/psutil/__init__.py", line 712, in username real_uid = self.uids().real File "/usr/lib/python2.7/dist-packages/psutil/_common.py", line 293, in wrapper return fun(self) File "/usr/lib/python2.7/dist-packages/psutil/__init__.py", line 750, in uids return self._proc.uids() File "/usr/lib/python2.7/dist-packages/psutil/_pslinux.py", line 1090, in wrapper raise NoSuchProcess(self.pid, self._name) NoSuchProcess: psutil.NoSuchProcess process no longer exists (pid=18137)
Again in Jenkins: https://jenkins.knut.univention.de:8181/job/UCS-4.4/job/UCS-4.4-1/job/AutotestJoin/34/SambaVersion=no-samba,Systemrolle=backup/testReport/86_selenium/160_process_overview_module/backup092/
Again in https://jenkins.knut.univention.de:8181/job/UCS-4.4/job/UCS-4.4-3/job/AutotestJoin/5/SambaVersion=no-samba,Systemrolle=slave/testReport/86_selenium/130_miscellaneous/slave094/.
The traceback is reliably reproducible by increasing the probability of a process not being existent during a call from psutil. This is achieved by modifying the top module's __init__.py and creating some additional short-lived processes on the vm while the test which produces the traceback is running. in /usr/lib/python2.7/dist-packages/univention/management/console/modules/top/__init__.py change line 59 to: for process in list(psutil.process_iter()): After that the /usr/share/ucs-test/86_selenium/160_process_overview_module test can be started. While the test is running create additional processes in the background. The traceback should occur shortly after. The traceback can be found in: /var/log/univention/management-console-web-server.log creates additional short-lived processes: while true; do for ((i=0; i<=100; i++)); do /bin/sleep 0.2 & done; sleep 0.2; done
Package: univention-management-console-module-top Version: 8.0.1-4A~4.4.0.202008281325 Branch: ucs_4.4-0 Scope: errata4.4-5 changed files: doc/errata/staging/univention-management-console-module-top.yaml management/univention-management-console-module-top/debian/changelog management/univention-management-console-module-top/umc/python/top/__init__.py commits (4.4-5): commit 9e232408b08097256a5eac91085df61394a1b818 (file changes) commit d3a5555fb8e4a234aede2fd5cd1c0c7a02aa1e0c (yaml) Notes regarding changes: - There was some code clean-up. A workaround for psutil version 2.2 and below has been removed completely since we are using version 5. - The NoSuchProcess exception is now caught and will no longer cause a traceback in UMC. QA: Please take note of my previous comment on how to reproduce the traceback. Same procedure can be used to test the working version. With the new version the psutil.NoSuchProcess traceback should no longer occur in the given context.
OK - fix looks good OK - univention-management-console-module-top OK - yaml
<https://errata.software-univention.de/#/?erratum=4.4x737>