Univention Bugzilla – Bug 34234
opening services module fails: race condition in service_info.py:pidof()
Last modified: 2017-04-04 18:28:11 CEST
Traceback reported by the UMC feedback: Die Ausführung des Kommandos services/query ist fehlgeschlagen: Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py", line 204, in execute func( request ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 178, in _response return function(self, request) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 305, in _response result = _multi_response(self, request) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 432, in _response for res in function(self, iterator, *nones): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 271, in _fake_func yield function(self, *args) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/services/__init__.py", line 62, in query srvs = usi.ServiceInfo() File "/usr/lib/pymodules/python2.6/univention/service_info.py", line 106, in __init__ self.update_services() File "/usr/lib/pymodules/python2.6/univention/service_info.py", line 140, in update_services self.__update_status( name, serv ) File "/usr/lib/pymodules/python2.6/univention/service_info.py", line 132, in __update_status if prog and not pidof( prog.strip() ): File "/usr/lib/pymodules/python2.6/univention/service_info.py", line 71, in pidof cmd = fd.readline() IOError: [Errno 3] Kein passender Prozess gefunden 3.2-0 errata61 (Borgfeld) The problem seems to be a race condition in pidof() in service_info.py line 71: 70 » » fd = open( cmdline ) 71 » » cmd = fd.readline() The function could maybe replaced by some function in psutil from the python stdlib. This bug should not occur very often.
Again reported (at Ticket #2014031721003841).
Reported again, so it does occur from time to time. And there is another (probably related) traceback - next line: Traceback: Die Ausführung des Kommandos services/query ist fehlgeschlagen: Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py", line 204, in execute func( request ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 178, in _response return function(self, request) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 305, in _response result = _multi_response(self, request) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 432, in _response for res in function(self, iterator, *nones): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 271, in _fake_func yield function(self, *args) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/services/__init__.py", line 62, in query srvs = usi.ServiceInfo() File "/usr/lib/pymodules/python2.6/univention/service_info.py", line 106, in __init__ self.update_services() File "/usr/lib/pymodules/python2.6/univention/service_info.py", line 140, in update_services self.__update_status( name, serv ) File "/usr/lib/pymodules/python2.6/univention/service_info.py", line 132, in __update_status if prog and not pidof( prog.strip() ): File "/usr/lib/pymodules/python2.6/univention/service_info.py", line 70, in pidof fd = open( cmdline ) IOError: [Errno 2] Datei oder Verzeichnis nicht gefunden: '/proc/21327/cmdline' 3.2-1 errata111 (Borgfeld)
Reported again: 4.0-0 errata10 (Walle)
Reported again, 4.0-1 errata163 (Walle) File "%PY2.7%/univention/service_info.py", line 132, in __update_status if prog and not pidof( prog.strip() ): File "%PY2.7%/univention/service_info.py", line 71, in pidof cmd = fd.readline() IOError: [Errno 3] Kein passender Prozess gefunden
Reported again, 4.1-0 errata7 (Vahr)
Reported again, 4.1-1 errata152 (Vahr) Remark: Fehlermeldung erscheint nach dem Startversuch des Dienstes
Fix is part of attachment 5166 [details] on Bug #31030. This happened again in our ucs-test jenkins environment: http://jenkins.knut.univention.de:8080/job/UCS-4.1/job/UCS-4.1-2/job/AutotestJoin/77/SambaVersion=s4,Systemrolle=master/testReport/60_umc-system/21_umc-service-proc-handling/test/
*** Bug 41789 has been marked as a duplicate of this bug. ***
*** Bug 40332 has been marked as a duplicate of this bug. ***
*** Bug 31030 has been marked as a duplicate of this bug. ***
r72654 | Bug #34234 ucr: Add comments r72653 | Bug #34234 ucr: Add debug output r72652 | Bug #34234 ucr: Move service check into Sevice class r72651 | Bug #34234 ucr: Protect against concurrent process changes r72650 | Bug #34234 ucr: Remove broken SysV init code r72649 | Bug #34234 ucr: Return service r72648 | Bug #34234 ucr: pyflakes r72647 | Bug #34234 ucr: autopep8 Package: univention-config-registry Version: 12.0.0-2A~4.2.0.201609161507 Branch: ucs_4.2-0
OK: Code review OK: exception is catched OK: All services are still detected correctly (except for those which doesn't event start currently in UCS 4.2). OK: Changelog
*** Bug 36903 has been marked as a duplicate of this bug. ***
*** Bug 38209 has been marked as a duplicate of this bug. ***
UCS 4.2 has been released: https://docs.software-univention.de/release-notes-4.2-0-en.html https://docs.software-univention.de/release-notes-4.2-0-de.html If this error occurs again, please use "Clone This Bug".