Univention Bugzilla – Bug 51166
handle error during start of exam more safely
Last modified: 2021-07-13 22:44:15 CEST
A customer encountered the problem that during the start of an exam the project variable in the UMC process was None. This triggered the following traceback: 07.02.20 11:50:24.628 MODULE ( PROCESS ) : Vorbereiten der Raumeinstellungen - beendet... 07.02.20 11:50:50.306 MODULE ( PROCESS ) : Setting auth type to u'SAML' 07.02.20 11:51:00.770 MODULE ( PROCESS ) : Diese Aktion erfordert die Eingabe Ihres Passwortes. 07.02.20 11:51:06.417 MODULE ( PROCESS ) : Setting auth type to None 07.02.20 11:51:06.531 MODULE ( ERROR ) : Traceback (most recent call last): File "/usr/sbin/univention-management-console-module", line 121, in <module> notifier.loop() File "/usr/lib/python2.7/dist-packages/notifier/nf_generic.py", line 296, in loop step() File "/usr/lib/python2.7/dist-packages/notifier/nf_generic.py", line 287, in step __min_timer = dispatch.dispatcher_run() File "/usr/lib/python2.7/dist-packages/notifier/dispatch.py", line 75, in dispatcher_run if not disp(): File "/usr/lib/python2.7/dist-packages/notifier/threads.py", line 161, in _simple_threads_dispatcher task.announce() File "/usr/lib/python2.7/dist-packages/notifier/threads.py", line 139, in announce self._callback(self, self._result) File "/usr/lib/python2.7/dist-packages/notifier/__init__.py", line 104, in __call__ return self._function(*tmp, **self._kwargs) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/schoolexam/__init__.py", line 557, in _finished my.project.starttime = datetime.datetime.now() AttributeError: 'NoneType' object has no attribute 'starttime' To counteract this problem we want to harden the UMC modul and always check this property to exist. If it is None for some reason, the project shall be reloaded from the project file and if this also fails, we want to provide more meaningful feedback in the log and to the customer.
When an error occurred in schoolexam/__init__.py -> start_exam() -> _thread() it was not logged an the following _finished() function didn't check for an exception, so it failed with the above error. The code has been changed to check the "result" condition and only continue if there was no exception in _thread(). [4.4] cc1a2118d Bug #51166: handle execption from _thread() in _finished() [4.4] f751b0a15 Bug #51166: advisory update ucs-school-umc-exam (9.0.1-37)
Advisory&Changelog: OK Tests: OK An UMC error containing the exception is now thrown and is not obscured anymore by following errors after running the thread. That will give us the chance to better debug upcoming errors in the exam module.
UCS@school 4.4 v5 has been released (errata update to the release). https://docs.software-univention.de/changelog-ucsschool-4.4v5-de.html If this error occurs again, please clone this bug.
git:cc1a2118dd55e315489160b13d4db4983723be58 is wrong and causes the module process to crash. You cannot/must not raise an exception in the notifier thread finish callback. I will revert and fix this correctly during the Python 3 migration.
see temporarily commit git:56b3e30def96d4b9327bf59fe78cfed0e1fbe5b2 for a fix.