Bug 50493

Summary: ImportError: "No module named <...>" with UCS 4.4-2 errata 348
Product: UCS Reporter: Erik Damrose <damrose>
Component: UDM (Generic)Assignee: Jürn Brodersen <brodersen>
Status: CLOSED FIXED QA Contact: Arvid Requate <requate>
Severity: normal    
Priority: P5 CC: best, brodersen
Version: UCS 4.4   
Target Milestone: UCS 4.4-2-errata   
Hardware: Other   
OS: Linux   
See Also: https://forge.univention.org/bugzilla/show_bug.cgi?id=49147
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?: 4: Will affect most installed domains How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.571 Enterprise Customer affected?:
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional): Regression
Max CVSS v3 score:

Description Erik Damrose univentionstaff 2019-11-13 18:46:28 CET
We received information that after updating to UCS 4.4-2 errata 348 an ImportError can occur, e.g.

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/univention/management/console/protocol/modserver.py", line 103, in _load_module
    self.__module = __import__(file_, [], [], modname)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/uvmm/__init__.py", line 45, in <module>
    from univention.management.console.modules.uvmm.profiles import Profiles
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/uvmm/profiles.py", line 46, in <module>
    univention.admin.modules.update()
  File "/usr/lib/python2.7/dist-packages/univention/admin/modules.py", line 123, 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/python2.7/dist-packages/univention/admin/modules.py", line 108, in _walk
    m = __import__(mod, globals(), locals(), name)
ImportError: No module named mailquota

See https://help.univention.com/t/13585

It seems some in some directories the __init__.py does not contain 
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Comment 1 Jürn Brodersen univentionstaff 2019-11-13 19:27:57 CET
[4.4-2 22f9b8e253] Bug #50493: Add missing extend_path in handler namespace packages

Package: univention-directory-manager-modules
Version: 14.0.14-17A~4.4.0.201911131922
Branch: ucs_4.4-0
Scope: errata4.4-2
Comment 2 Florian Best univentionstaff 2019-11-13 19:52:57 CET
hooks.d/__init__.py doesn't need this because it's imported via import_hooks() which goes the whole sys.path along.
Comment 3 Arvid Requate univentionstaff 2019-11-13 20:07:04 CET
95e94cf88f | Advisory

Verified:
* Code review
* Package update and functional test
* Advisory
Comment 4 Erik Damrose univentionstaff 2019-11-13 20:27:15 CET
<http://errata.software-univention.de/ucs/4.4/349.html>