Problem: udm is broken after installing ox-connector in a distributed environment

Problem:

If you update the primary and the repolica with OX to the latest UCS version in a distributed environment with OX, all join scripts do not run automatically on the replica. If you do not run them manually before installing the OX connector on the primary udm breaks due to existing old handler modules.

root@ucs:~# udm
E: Can`t find running daemon after 50.0 seconds. (No socketfile)

Investigation:

root@ucs:~/univention-support# python3 -m univention.admincli.admin
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3/dist-packages/univention/admincli/admin.py", line 58, in <module>
    univention.admin.modules.update()
  File "/usr/lib/python3/dist-packages/univention/admin/modules.py", line 153, in update
    _walk(root, w_root, w_files)
  File "/usr/lib/python3/dist-packages/univention/admin/modules.py", line 140, in _walk
    m = importlib.import_module('univention.admin.handlers.%s' % (modulepackage,))  # type: Any
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/oxmail/oxmail.py", line 40, in <module>
    import univention.admin.handlers.oxmail.oxfolder
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/oxmail/oxfolder.py", line 72, in <module>
    syntax=univention.admin.syntax.ox_mail_folder_name,
AttributeError: module 'univention.admin.syntax' has no attribute 'ox_mail_folder_name'

Solution:

Check with the command above, which modules need to be removed.
python3 -m univention.admincli.admin

File “/usr/lib/python3/dist-packages/univention/admin/handlers/oxmail/oxfolder.py”, line 72, in
syntax=univention.admin.syntax.ox_mail_folder_name,
AttributeError: module ‘univention.admin.syntax’ has no attribute ‘ox_mail_folder_name’

File “/usr/lib/python3/dist-packages/univention/admin/handlers/oxmail/oxmail.py”, line 40, in
import univention.admin.handlers.oxmail.oxfolder
ModuleNotFoundError: No module named ‘univention.admin.handlers.oxmail.oxfolder’

File “/usr/lib/python3/dist-packages/univention/admin/handlers/oxmail/oxfetchmailmulti.py”, line 93, in
syntax=univention.admin.syntax.oxFetchmailProtocol,
AttributeError: module ‘univention.admin.syntax’ has no attribute ‘oxFetchmailProtocol’

And remove them:

root@ucs:~/univention-support# mv /usr/lib/python3/dist-packages/univention/admin/handlers/oxmail/oxfolder.py .
root@ucs:~/univention-support# mv /usr/lib/python3/dist-packages/univention/admin/handlers/oxmail/oxmail.py .
root@ucs:~/univention-support# mv /usr/lib/python3/dist-packages/univention/admin/handlers/oxmail/oxfetchmailmulti.py .

If the command shows

root@ucs:~/univention-support# python3 -m univention.admincli.admin
univention-directory-manager: command line interface for managing UCS
[...]

and udm users/user list is working again, it should be fine again.
You can run the pending joinscripts

Mastodon