Bug 37347 - UDM cache: New Extended Attributes are rendered incorrectly
UDM cache: New Extended Attributes are rendered incorrectly
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0-1-errata
Assigned To: Alexander Kläser
Florian Best
:
: 37118 37615 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-12-15 14:02 CET by Dirk Wiesenthal
Modified: 2015-03-25 09:19 CET (History)
3 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Usability
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2014-12-15 14:02:38 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.
Comment 1 Dirk Wiesenthal univentionstaff 2015-01-28 13:34:02 CET
*** Bug 37615 has been marked as a duplicate of this bug. ***
Comment 2 Dirk Wiesenthal univentionstaff 2015-01-28 13:36:00 CET
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.
Comment 3 Alexander Kläser univentionstaff 2015-02-10 14:41:29 CET
AFAIK, the data is cached on the frontend side and on the backend side.
Bug 37751 could be a possible workaround.
Comment 4 Drees Dormann univentionstaff 2015-02-10 15:20:27 CET
*** Bug 37118 has been marked as a duplicate of this bug. ***
Comment 5 Alexander Kläser univentionstaff 2015-02-13 16:44:21 CET
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 :) .
Comment 6 Alexander Kläser univentionstaff 2015-02-13 18:11:24 CET
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
Comment 7 Alexander Kläser univentionstaff 2015-02-15 17:19:10 CET
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
Comment 8 Alexander Kläser univentionstaff 2015-02-16 11:52:33 CET
YAML files have been updated [r58093].
Comment 9 Florian Best univentionstaff 2015-02-17 16:31:19 CET
After importing a new license the user is forced to logout. Can we do the same here?
Comment 10 Florian Best univentionstaff 2015-02-18 11:54:53 CET
(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', {
Comment 11 Alexander Kläser univentionstaff 2015-02-18 14:19:30 CET
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
Comment 12 Alexander Kläser univentionstaff 2015-02-18 15:04:43 CET
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
Comment 13 Florian Best univentionstaff 2015-02-18 15:25:01 CET
In case the /umcp/sso call fails nothing happens, the old session is still active.
lib/sso/getsession works.
Comment 14 Florian Best univentionstaff 2015-02-18 16:24:24 CET
(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.
Comment 15 Alexander Kläser univentionstaff 2015-02-18 19:04:55 CET
(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
Comment 16 Florian Best univentionstaff 2015-02-19 15:17:07 CET
the standby animation is shown without the white loading animation. probably a missing this.standby(false) before this.standbyDuring(reload).
Comment 17 Alexander Kläser univentionstaff 2015-02-19 16:53:06 CET
(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
Comment 18 Florian Best univentionstaff 2015-02-19 17:27:17 CET
Ok, very nice.
Comment 19 Moritz Muehlenhoff univentionstaff 2015-02-24 08:22:56 CET
http://errata.univention.de/ucs/4.0/92.html
Comment 20 Moritz Muehlenhoff univentionstaff 2015-02-24 08:24:10 CET
http://errata.univention.de/ucs/4.0/90.html
Comment 21 Moritz Muehlenhoff univentionstaff 2015-02-24 08:25:05 CET
http://errata.univention.de/ucs/4.0/87.html
Comment 22 Moritz Muehlenhoff univentionstaff 2015-03-11 15:10:00 CET
http://errata.univention.de/ucs/4.0/96.html