Univention Bugzilla – Bug 37447
UMC-server crashes when extendedAttributes are not known
Last modified: 2015-04-09 11:28:17 CEST
I found a traceback in the UMC server: File "/usr/sbin/univention-management-console-server", line 209, in <module> umc_daemon.do_action() File "/usr/lib/pymodules/python2.7/daemon/runner.py", line 186, in do_action func(self) File "/usr/sbin/univention-management-console-server", line 142, in _restart self._start() File "/usr/lib/pymodules/python2.7/daemon/runner.py", line 131, in _start self.app.run() File "/usr/sbin/univention-management-console-server", line 192, in run notifier.loop() File "/usr/lib/pymodules/python2.7/notifier/nf_generic.py", line 284, in loop step() File "/usr/lib/pymodules/python2.7/notifier/nf_generic.py", line 271, in step not __sockets[ cond ][ fd ]( sock_obj ): File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/server.py", line 168, in _receive self._handle(state, msg) File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/server.py", line 286, in _handle state.processor.request(msg) File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 289, in request self.handle_request_set(msg) File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 573, in handle_request_set userObj.modify() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 364, in modify return self._modify(modify_childs,ignore_license=ignore_license) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 823, in _modify ml=self._ldap_modlist() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/users/user.py", line 1940, in _ldap_modlist ml=univention.admin.handlers.simpleLdap._ldap_modlist(self) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 659, in _ldap_modlist diff_ml = self.diff() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 127, in diff if self.descriptions[key].multivalue: KeyError: 'owncloudEnabled' Seems to happen when the app was already installed, uninstalled. In a fresh session (where at the start owncloudEnabled is not yet known) ownCloud is installed again. Right after the installation, the frontend sends a SET PREFERENCES and this crashes the whole server. Not so sure how to fix it. One could add a KeyError in the except clause, but this leads to error messages and preferences not being saved (although irrelevant at this point). Maybe it is better to: udm_modules.init(self.lo, self.po, users_module, force_reload=True) every time in univention/management/console/protocol/session.py's _get_user_obj(). Not sure about the performance though. On the other hand, this is done in any UDM module all the time...
Is this problem being resolved with Bug 37347?
(In reply to Alexander Kläser from comment #1) > Is this problem being resolved with Bug 37347? No, the server still crashes.
Along with this bug I fixed a lot of server crashes which could be done through malicious user input (e.g. null bytes in requests) or LDAP errors (because udm_errors.base is not catched): E.g.: umc-client -U Administrator -P univention -s 10.200.27.6 SET '' -e -o '{"locale": "\x00"}' umc-client -U Administrator -P univention -s 10.200.27.6 SET '' -e -o '{"user": {"preferences": "\x00"}}' I replaced the usage of the users/user handlers module by raw LDAP. Fix: svn r59293 YAML: 2015-03-13-univention-management-console.yaml EUIIM I tried my best to write a script which provokes this error also without the UMC server to fix the underlying UDM errors but could not. It is easy reproducible: just remove the extended attribute and set one favorite.
Created attachment 6774 [details] 37447.py
24.03.15 10:05:37.008 MAIN ( ERROR ) : Traceback (most recent call last): File "/usr/sbin/univention-management-console-server", line 210, in <module> umc_daemon.do_action() File "/usr/lib/pymodules/python2.7/daemon/runner.py", line 186, in do_action func(self) File "/usr/sbin/univention-management-console-server", line 142, in _restart self._start() File "/usr/lib/pymodules/python2.7/daemon/runner.py", line 131, in _start self.app.run() File "/usr/sbin/univention-management-console-server", line 192, in run notifier.loop() File "/usr/lib/pymodules/python2.7/notifier/nf_generic.py", line 284, in loop step() File "/usr/lib/pymodules/python2.7/notifier/nf_generic.py", line 271, in step not __sockets[ cond ][ fd ]( sock_obj ): File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/server.py", line 159, in _receive self._handle(state, msg) File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/server.py", line 277, in _handle state.processor.request(msg) File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 282, in request self.handle_request_get(msg) File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 393, in handle_request_get favorites = self._get_user_favorites() File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 569, in _get_user_favorites favorites = self._get_user_preferences(self._get_user_connection()).setdefault('favorites', ucr.get('umc/web/favorites/default', '')).strip() File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 540, in _get_user_preferences return dict(val.split('=', 1) if '=' in val else (val, '') for val in preferences) TypeError: 'NoneType' object is not iterable
(In reply to Florian Best from comment #5) > "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session. > py", line 540, in _get_user_preferences > return dict(val.split('=', 1) if '=' in val else (val, '') for val in > preferences) > TypeError: 'NoneType' object is not iterable This error happened if a user did not have the attribute univentionUMCProperty set. Fixed in svn r59334.
(In reply to Dirk Wiesenthal from comment #0) > I found a traceback in the UMC server: > [...] > File > "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line > 127, in diff > if self.descriptions[key].multivalue: > KeyError: 'owncloudEnabled' OK, this works now, cool! I could reproduce the error in the following manner: (1) install owncloud (1st time) (2) uninstall owncloud (3) install owncloud → the session renewed automatically → UMC server crashes (4) goto (2) (In reply to Florian Best from comment #6) > (In reply to Florian Best from comment #5) > > "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session. > > py", line 540, in _get_user_preferences > > return dict(val.split('=', 1) if '=' in val else (val, '') for val in > > preferences) > > TypeError: 'NoneType' object is not iterable > > This error happened if a user did not have the attribute > univentionUMCProperty set. Fixed in svn r59334. OK, this works fine now, could not re-provoke this error with the new version. YAML entry: OK, I made minor adjustments and adapted the package version [r59339, r59340].
<http://errata.univention.de/ucs/4.0/125.html>