Bug 39013 - admin.modules.update() should handle ImportError
admin.modules.update() should handle ImportError
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0-x
Assigned To: UMC maintainers
:
: 32589 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-23 12:40 CEST by Florian Best
Modified: 2019-05-03 10:07 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
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): Error handling
Max CVSS v3 score:
best: Patch_Available+


Attachments
patch (1.05 KB, patch)
2015-07-23 12:40 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2015-07-23 12:40:25 CEST
Created attachment 7044 [details]
patch

If something fails in univention.admin.modules.update() nothing is possible anymore. UMC-webserver restart fails, udm-cli is broken, ….

We could ignore import errors there so that failing handlers doesn't block the rest.
The disadvantage could be that we don't recognize errors like Bug #39004.

Attached is a patch.

Here an example traceback:

# service univention-management-console-web-server restart
Restarting Univention Management Console Web Server.
Traceback (most recent call last):
  File "/usr/sbin/univention-management-console-web-server", line 55, in <module>
    import univention.management.console.protocol as umcp
  File "/usr/lib/pymodules/python2.6/univention/management/console/protocol/__init__.py", line 187, in <module>
    from session import *
  File "/usr/lib/pymodules/python2.6/univention/management/console/protocol/session.py", line 72, in <module>
    udm_modules.update()
  File "/usr/lib/pymodules/python2.6/univention/admin/modules.py", line 92, in update
    os.path.walk(dir, _walk, p)
  File "/usr/lib/python2.6/posixpath.py", line 236, in walk
    walk(name, func, arg)
  File "/usr/lib/python2.6/posixpath.py", line 228, in walk
    func(arg, top, names)
  File "/usr/lib/pymodules/python2.6/univention/admin/modules.py", line 76, in _walk
    m=__import__(mod, globals(), locals(), name)
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/policies/__init__.py", line 46, in <module>
    os.path.walk( path, __walk, path )
  File "/usr/lib/python2.6/posixpath.py", line 228, in walk
    func(arg, top, names)
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/policies/__init__.py", line 43, in __walk
    policies.append( __import__( file[ : -3 ], globals(), locals(), [ '' ] ) )
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/policies/mailquota.py", line 40, in <module>
    from univention.admin.policy import (
ImportError: No module named policy
done.
Comment 1 Florian Best univentionstaff 2016-05-09 08:04:24 CEST
*** Bug 32589 has been marked as a duplicate of this bug. ***
Comment 2 Stefan Gohmann univentionstaff 2019-01-03 07:17:36 CET
This issue has been filled against UCS 4.0. The maintenance with bug and security fixes for UCS 4.0 has ended on 31st of May 2016.

Customers still on UCS 4.0 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.