Univention Bugzilla – Bug 43152
Improve error handling of setup scripts: write traceback to frontend
Last modified: 2017-11-10 15:42:10 CET
Version: 4.1-4 errata332 (Vahr) Einrichten der Active-Directory-Verbindung:
The problem here is the error handling in SetupScript: » » except Exception as e: » » » self.error(str(e)) This writes an empty string as error message to the progress. We don't know which exception it was. The original error comes from usr/lib/univention-system-setup/scripts/90_postjoin/10admember. Instead we should write the traceback into the progress, so that this is sent for all unhandled exceptions. All other setup scripts already handle exceptions well, so that no additional tracebacks would occur. If they need to pass a error string message to the frontend they can (and already do) call "self.error(message); return False" in inner_run(). Bug #43277 comment 2 also happens due to this. univention-system-setup (10.0.10-37): r82080 | Bug #43152: improve error handling of SetupScript by sending tracebacks to the frontend. univention-system-setup.yaml: r82081 | YAML Bug #43152
*** Bug 45016 has been marked as a duplicate of this bug. ***
Looks good to me :) What I tested: cd /usr/share/pyshared/univention/management/console/modules/setup/ python -c "from setup_script import SetupScript; foo = SetupScript(); foo.run()" > /tmp/test.log Content of /tmp/test.log: """ __ERR__:Traceback (most recent call last): File "setup_script.py", line 310, in run success = self.inner_run() File "setup_script.py", line 334, in inner_run raise NotImplementedError('Define your own inner_run() method, please.') NotImplementedError: Define your own inner_run() method, please. Traceback (most recent call last): File "setup_script.py", line 310, in run success = self.inner_run() File "setup_script.py", line 334, in inner_run raise NotImplementedError('Define your own inner_run() method, please.') NotImplementedError: Define your own inner_run() method, please. """ -> OK YAML -> OK
<http://errata.software-univention.de/ucs/4.2/150.html>