Univention Bugzilla – Bug 37347
UDM cache: New Extended Attributes are rendered incorrectly
Last modified: 2015-03-25 09:19:39 CET
Either the frontend or the backend cache has a problem with a newly added Extended Attribute. If the attribute is added via a join script of a new package (e.g. an App) which should be rendered by UMC as a special widget (e.g. ComboBox), the widget is instead a very simple TextBox (probably fallback). The App Center encourages to reload the UMC server, but if the user decides to not do so, the widget is bugged (if the UDM module was opened before). One may say that the user refused to do as the UMC suggested and that even than it is only a minor bug. But if this can be fixed, the App Center does not have to suggest a disrupting action at all. After an app installation, everything works smoothly.
*** Bug 37615 has been marked as a duplicate of this bug. ***
See Bug#37615 for an example. Problem seems to be a bit more complicated than initially thought. A mere page reload does not work, a new session is required. This is especially annoying in UCS 4.0 since only a reload is suggested in the App Center.
AFAIK, the data is cached on the frontend side and on the backend side. Bug 37751 could be a possible workaround.
*** Bug 37118 has been marked as a duplicate of this bug. ***
This problem also occurs currently when performing a reload as is proposed by the app center. As consequence, the backend module processes remain the same after the reload. As discussed, we will implement the following strategy: (a) After an app installation, automatically renew the UMC backend session. This can be done via our UMC SSO feature: > tools = require('umc/tools'); > request = require('dojo/request'); > cookie = require('dojo/cookie'); > console.log('cookie:', cookie('UMCSessionId')); > tools.umcpCommand('lib/sso/getsession', { > host: 'localhost' > }).then(function(resp) { > console.log('loginToken:', resp.result.loginToken); > request('/umcp/sso', { > query: { > loginToken: resp.result.loginToken > } > }).then(function() { > console.log('cookie:', cookie('UMCSessionId')); > }); > }); An example output would be: > cookie: 2fb22016-c0e5-4d28-a5bf-d28fe9c468ef > loginToken: 0d0d70a5378156d64bdbb468486451627f86d9263ecc88854389236f8c909277 > cookie: d7bb0664-3863-46e5-a08c-883b5dcca942 ... so the cookie is changed successfully by the last command. For this to work, we need to circumvent the hostname check in u-m-c-module-lib when "localhost" is given, i.e.: > Index: umc/python/lib/server.py > =================================================================== > --- umc/python/lib/server.py (Revision 58025) > +++ umc/python/lib/server.py (Arbeitskopie) > @@ -174,7 +174,7 @@ > key_file='/etc/univention/ssl/%s/private.key' % ucr.get('hostname'), > cert_file='/etc/univention/ssl/%s/cert.pem' % ucr.get('hostname'), > ca_certs_file='/etc/univention/ssl/ucsCA/CAcert.pem', > - check_hostname=True, > + check_hostname=(host != 'localhost'), > )) > > cookie_jar = cookielib.CookieJar() (b) Cached data in modules should be reset, most importantly the UDM cache. A good way to do so would be via callback functionality similar to tools.registerOnStartup(): > tools.registerOnReset(function() { reload_udm_cache(); }) (c) If the app has installed some UMC parts, a reload should be performed (this dialogue will pop up anyway), otherwise this is not necessary. A simple call to tools.checkReloadRequired() should be sufficient. (d) Done :) .
Changes have been committed... YAML files have not yet been adapted. univention-management-console-module-lib (4.0.2-3): * Bug #37347: allow a call to lib/server/sso with host=localhost univention-management-console-frontend (4.1.106-17): * Bug #37347: add methods for resetting UMC modules and renewing a session univention-management-console-module-udm (5.1.25-45): * Bug #37347: clear UDM cache via tools.registerOnReset() univention-management-console-module-appcenter (4.1.20-3): * Bug #37347: reset UMC modules, renew the UMC session and only reload UMC if necessary after installing apps or software packages
I added a fallback in case lib/server/getsession cannot be accessed. The session is then simply closed and thus the login dialogue is shown. This should not collide with the calls to reloading the list of modules, AFAIS. I also fixed two minor things along the way... univention-management-console-frontend (4.1.106-18): * Bug #37347: add fallback for tools.renewSession() if lib/server/getsession is not accessible
YAML files have been updated [r58093].
After importing a new license the user is forced to logout. Can we do the same here?
(In reply to Alexander Kläser from comment #6) > univention-management-console-module-lib (4.0.2-3): > * Bug #37347: allow a call to lib/server/sso with host=localhost OK > univention-management-console-frontend (4.1.106-17): > * Bug #37347: add methods for resetting UMC modules and renewing a session ~ > univention-management-console-module-udm (5.1.25-45): > * Bug #37347: clear UDM cache via tools.registerOnReset() OK > univention-management-console-module-appcenter (4.1.20-3): > * Bug #37347: reset UMC modules, renew the UMC session and only reload UMC > if necessary after installing apps or software packages ~TODO (In reply to Alexander Kläser from comment #7) > I added a fallback in case lib/server/getsession cannot be accessed. The > session is then simply closed and thus the login dialogue is shown. This > should not collide with the calls to reloading the list of modules, AFAIS. I > also fixed two minor things along the way... OK: two minor things > univention-management-console-frontend (4.1.106-18): > * Bug #37347: add fallback for tools.renewSession() if lib/server/getsession > is not accessible REOPEN: WARNING: Could not renew session, access to lib/sso/getsession not granted... forcing re-login again instead: ReferenceError: request is not defined {stack: (...), message: "request is not defined"} in > return request('/umcp/sso', {
Fixed. It should work now. univention-management-console-frontend (4.1.106-22): Bug #37347: * fixed wrong reference to request() * added error handler for umc.dialog.login() to avoid tracebacks
univention-management-console-module-appcenter (4.1.20-4): * Bug #37347: remove versioned dependency to u-m-c-module-lib univention-management-console-frontend (4.1.106-23): * Bug #37347: remove versioned dependency to u-m-c-frontend-theme
In case the /umcp/sso call fails nothing happens, the old session is still active. lib/sso/getsession works.
(In reply to Florian Best from comment #13) > In case the /umcp/sso call fails nothing happens, the old session is still > active. Everything else works very fine and opens doors for further improvement and usage.
(In reply to Florian Best from comment #14) > (In reply to Florian Best from comment #13) > > In case the /umcp/sso call fails nothing happens, the old session is still > > active. > Everything else works very fine and opens doors for further improvement and > usage. I fixed the handling of deferreds in umc/tools and in the appcenter module. I spotted a bug in umc/tools::defer() which I fixed: The call to deferred.resolve(func()) would immediately resolve the deferred, even when func() would return another Deferred. univention-management-console-frontend (4.1.106-26): * Bug #37347: fix deferred handling in tools.defer() renewSession() univention-management-console-module-appcenter (4.1.20-5): * Bug #37347: correct command order in restartOrReload() methods
the standby animation is shown without the white loading animation. probably a missing this.standby(false) before this.standbyDuring(reload).
(In reply to Florian Best from comment #16) > the standby animation is shown without the white loading animation. probably > a missing this.standby(false) before this.standbyDuring(reload). A bit trickier than I thought... r58282 univention-management-console-module-appcenter (4.1.20-6): Bug #37347: * show progress bar during session and module data update * show standby animation in package management module until form is ready
Ok, very nice.
http://errata.univention.de/ucs/4.0/92.html
http://errata.univention.de/ucs/4.0/90.html
http://errata.univention.de/ucs/4.0/87.html
http://errata.univention.de/ucs/4.0/96.html