Bug 49832 - Installed apps are not visible on user 'Apps' tab after installing errata updates
Installed apps are not visible on user 'Apps' tab after installing errata upd...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: App Center
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-1-errata
Assigned To: Jannik Ahlers
Johannes Keiser
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-07-10 13:56 CEST by Erik Damrose
Modified: 2019-10-17 10:40 CEST (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.171
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Damrose univentionstaff 2019-07-10 13:56:06 CEST
Some 4.4 errata update [1] breaks the visibility of the 'Apps' tab. This new 4.4 feature is then not available on user objects in UMC, and the attribute is displayed at the previous place, e.g. at the advanced settings tab. Users may not find the option if is not on the Apps tab.

To reproduce:
UCS 4.4e0, install owncloud; check that owncloud is visible on app tab
Update to latest errata; No Apps tab, owncloud option visible on advanced settings tab
Update owncloud app: no change in behavior

[1] Somewhere between e0 and e137 - if i try to reproduce it and start with an UCS with e137+, the tab does not disappear.
Comment 1 Nico Gulden univentionstaff 2019-07-15 19:47:16 CEST
The following command re-initializes the directory listener for the app attributes and brings the Apps tab back:

univention-directory-listener-ctrl resync app_attributes
Comment 2 Jannik Ahlers univentionstaff 2019-07-18 17:06:23 CEST
Successful build
Package: univention-directory-listener
Version: 13.0.2-6A~4.4.0.201907181703
Branch: ucs_4.4-0
Scope: errata4.4-1

I put Nico's command into the postinst of the univention-directory-listener package.
Comment 3 Florian Best univentionstaff 2019-07-18 17:18:32 CEST
What is the real cause of this issue? Which errata update caused the inconsistency?
Comment 4 Jannik Ahlers univentionstaff 2019-07-23 16:46:09 CEST
I made changes according to QA feedback

Successful build
Package: univention-directory-listener
Version: 13.0.2-8A~4.4.0.201907231642
Branch: ucs_4.4-0
Scope: errata4.4-1
Comment 5 Jannik Ahlers univentionstaff 2019-07-23 17:27:37 CEST
I made a typo.

Successful build
Package: univention-directory-listener
Version: 13.0.2-9A~4.4.0.201907231725
Branch: ucs_4.4-0
Scope: errata4.4-1
Comment 6 Philipp Hahn univentionstaff 2019-07-24 10:26:11 CEST
(In reply to Jannik Ahlers from comment #2)
> I put Nico's command into the postinst of the univention-directory-listener
> package.

VETO: Do not put that in UDL - this is a gross layering violation as UDL only provides the services and you MUST NOT assume that any specific module is installed.
Comment 7 Jannik Ahlers univentionstaff 2019-07-24 11:35:57 CEST
- I moved the command to univention-management-console-module-appcenter.postinst

- The listener package was restored to its previous state and the new version was removed from the build system (Felix did a change to the build dependencies which will need to stay so the build doesn't fail for the next person)

Successful build
Package: univention-appcenter
Version: 8.0.11-46A~4.4.0.201907241126
Branch: ucs_4.4-0
Scope: errata4.4-1
Comment 8 Johannes Keiser univentionstaff 2019-07-25 10:18:33 CEST
OK: App tabs are visible again after upgrade
OK: YAML
-> verified
Comment 9 Florian Best univentionstaff 2019-07-25 17:47:49 CEST
The real cause of this Bug is Bug #49147 - because the listener script is triggered in the pre-inst(?) phase while the UDM package is updated but no new symlinks are created yet!

Therefore one can see (hundrets of) these tracebacks in the listener.log:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/univention/listener/api_adapter.py", line 155, in _handler
    self._module_handler.create(dn, new)
  File "/usr/lib/univention-directory-listener/system/app_attributes.py", line 194, in create
    self._write_json_without_some_debug_output()
  File "/usr/lib/univention-directory-listener/system/app_attributes.py", line 66, in _write_json_without_some_debug_output
    self._write_json()
  File "/usr/lib/univention-directory-listener/system/app_attributes.py", line 79, in _write_json
    app_objs = search_objects('appcenter/app', self.lo, self.po)
  File "/usr/lib/python2.7/dist-packages/univention/appcenter/udm.py", line 120, in search_objects
    module = _get_module(_module, _lo, _pos)
  File "/usr/lib/python2.7/dist-packages/univention/appcenter/udm.py", line 66, in _get_module
    _update_modules()
  File "/usr/lib/python2.7/dist-packages/univention/appcenter/udm.py", line 62, in _update_modules
    udm_modules.update()
  File "/usr/lib/pymodules/python2.7/univention/admin/modules.py", line 121, in update
    os.path.walk(dir, _walk, p)
  File "/usr/lib/python2.7/posixpath.py", line 239, in walk
    walk(name, func, arg)
  File "/usr/lib/python2.7/posixpath.py", line 231, in walk
    func(arg, top, names)
  File "/usr/lib/pymodules/python2.7/univention/admin/modules.py", line 106, in _walk
    m = __import__(mod, globals(), locals(), name)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/computers/__init__.py", line 46, in <module>
    os.path.walk(path, __walk, path)
  File "/usr/lib/python2.7/posixpath.py", line 231, in walk
    func(arg, top, names)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/computers/__init__.py", line 42, in __walk
    computers.append(__import__(file_[: -3], globals(), locals(), ['']))
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/computers/domaincontroller_backup.py", line 38, in <module>
    from univention.admin.handlers.computers.__base import ComputerObject
ImportError: No module named __base

The applied fix is therefore only a one time solution and this will break again if we have changes in UDM and UDM does not yet use dh_python2.

Other listener scripts are potentially also affected, e.g. another traceback we can see:

23.07.19 10:14:16.109  LISTENER    ( ERROR   ) : import of filename=/usr/lib/univention-directory-listener/system/faillog.py failed
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/faillog.py", line 42, in <module>
    from univention.admin.handlers.users.user import unmapLocked
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/users/user.py", line 53, in <module>
    import univention.admin.handlers.groups.group
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/groups/group.py", line 1010, in <module>
    identify = object.identify
AttributeError: type object 'object' has no attribute 'identify'
Comment 10 Arvid Requate univentionstaff 2019-07-31 13:58:44 CEST
<http://errata.software-univention.de/ucs/4.4/200.html>
Comment 11 Florian Best univentionstaff 2019-09-20 18:24:14 CEST
The next traceback which will occur is:
ImportError: No module named types
Comment 12 Florian Best univentionstaff 2019-10-17 10:21:28 CEST
Here we go:

Traceback (most recent call last):
  File "/usr/sbin/univention-management-console-server", line 243, in <module>
    umc_daemon.do_action()
  File "/usr/lib/python2.7/dist-packages/daemon/runner.py", line 267, in do_action
    func(self)
  File "/usr/lib/python2.7/dist-packages/daemon/runner.py", line 186, in _start
    self.app.run()
  File "/usr/sbin/univention-management-console-server", line 199, in run 
    from univention.management.console.protocol.server import Server
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/__init__.py", line 187, in <module>
    from session import *
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 53, in <module>
    import univention.admin.uexceptions as udm_errors
  File "/usr/lib/pymodules/python2.7/univention/admin/__init__.py", line 630, in <module>
    from univention.admin import modules, objects, syntax, hook, mapping  # noqa
  File "/usr/lib/pymodules/python2.7/univention/admin/modules.py", line 47, in <module>
    import univention.admin.syntax
  File "/usr/lib/pymodules/python2.7/univention/admin/syntax.py", line 60, in <module>
    import univention.admin.types
 ImportError: No module named types
Comment 13 Erik Damrose univentionstaff 2019-10-17 10:40:32 CEST
Please do not add comments to closed bugs. If this error occured again please clone a new bug.