Univention Bugzilla – Bug 37366
unify UMC server/module error handling
Last modified: 2015-05-28 16:48:28 CEST
The internal error handling should be unified so that UMC-Server + UMC-Modules + Threaded-Methods all use the same error handling function. This has the advantage that the server will be more robust. Currently it crashes at every exception in the internal server commands. This can be prevented if we use the generic error handling which is already outsourced into a single function/decorator. The status codes which differentiate a UMC-Module error and a UMC-Server error are not necessary. The real HTTP status code 500 should be used. A unified format of the JSON error response could be implemented for errors. Currently everything is a string using the "message" attribute of the UMCP response. Status titles are generated by the frontend, this is the job of the backend (errors should be viewable independent of the user agent software). +++ This bug was initially created as a clone of Bug #37169 +++
*** Bug 25987 has been marked as a duplicate of this bug. ***
Using this bug to make the UMC server robust against crashing during request processing.
*** Bug 34047 has been marked as a duplicate of this bug. ***
*** Bug 35972 has been marked as a duplicate of this bug. ***
*** Bug 38018 has been marked as a duplicate of this bug. ***
*** Bug 37458 has been marked as a duplicate of this bug. ***
The UMC can't crash anymore when handling requests. It is still possible that it crashes on startup. This could be fixed via Bug #33427 or more explicit in another bug. The internal UMC commands now have the same error handling as the modules. Nothing changed in the traceback format (I will do this in Bug #38204). Nice side effects: Modules are now also able to call self.get_user_ldap_connection(). Internal server functions may now use our decorators/sanitizers. YAML: 2015-05-12-univention-management-console.yaml Package: univention-management-console Version: 7.1.63-17.859.201505131137
Currently a import error when protocol is not imported first. E.g. on python-cli: "import univention.management.console.modules"
univention-management-console (7.1.63-18): r60749 | Bug #37366: fix import order
Thx for fixing - this currently prevents useful debugging on 3.2 customer environments with computerroom issues. I see "Attribute status just available for MIME type application/json" like 10 times a seconds in ...server.log and ...web-server.log. Backport would be highly appreciated
The translation is broken due to r60749.
(In reply to Florian Best from comment #11) > The translation is broken due to r60749. The order of setting the locale and importing the module did matter because the univention.lib.Translation() instances were bound to the set locale on import time. Example (was broken, is fixed again): >>> from univention.management.console import Translation >>> from locale import * >>> setlocale(LC_ALL, 'de_DE.UTF-8') 'de_DE.UTF-8' >>> _ = Translation('univention-management-console').translate >>> _('The account is expired and can not be used anymore') 'The account is expired and can not be used anymore' → is german again. Well, this is a general problem we ever had and also have in udm. I added some comments to the code so that this will not occur again.
All YAML descriptions have been adapted. The order of bug numbers fit to the descriptions. Every bug has it's own description. Please recheck *appcenter.yaml, *lib.yaml, *console.yaml.
OK, works. YAML OK
<http://errata.univention.de/ucs/4.0/199.html>