Problem: Nach einem Update wird bei einem Import von Benutzern ein Traceback mit "rename_callback" erzeugt

Problem:

Nach einem Update wird bei einem Import von Benutzern der folgende Fehler im Import-Log angezeigt:

2021-11-10 15:38:54 ERROR modify() got an unexpected keyword argument 'rename_callback'
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/ucsschool/importer/mass_import/mass_import.py", line 125, in import_users
    user_import.create_and_modify_users(imported_users)  # 90% - 100%
  File "/usr/lib/python2.7/dist-packages/ucsschool/importer/mass_import/user_import.py", line 168, in create_and_modify_users
    user = self.determine_add_modify_action(imported_user)
  File "/usr/lib/python2.7/dist-packages/ucsschool/importer/mass_import/user_import.py", line 341, in determine_add_modify_action
    return self.prepare_imported_user(imported_user, None)
  File "/usr/lib/python2.7/dist-packages/ucsschool/importer/mass_import/sisopi_user_import.py", line 160, in prepare_imported_user
    return super(SingleSourcePartialUserImport, self).prepare_imported_user(imported_user, old_user)
  File "/usr/lib/python2.7/dist-packages/ucsschool/importer/mass_import/user_import.py", line 320, in prepare_imported_user
    imported_user.prepare_all(new_user=not old_user)
  File "/usr/lib/python2.7/dist-packages/ucsschool/importer/models/import_user.py", line 620, in prepare_all
    self.prepare_attributes(new_user)
  File "/usr/lib/python2.7/dist-packages/ucsschool/importer/models/import_user.py", line 634, in prepare_attributes
    self.make_username()
  File "/usr/lib/python2.7/dist-packages/ucsschool/importer/models/import_user.py", line 1038, in make_username
    self.name = self.username_handler.format_name(self.name)
  File "/usr/lib/python2.7/dist-packages/ucsschool/importer/utils/username_handler.py", line 402, in format_name
    counter = func(without_pattern) if without_pattern else ""
  File "/usr/lib/python2.7/dist-packages/ucsschool/importer/utils/username_handler.py", line 452, in counter2
    return self.get_and_raise(name_base, "")
  File "/usr/lib/python2.7/dist-packages/ucsschool/importer/utils/username_handler.py", line 466, in get_and_raise
    self.storage_backend.modify(name_base, num, num + 1)
  File "/usr/lib/python2.7/dist-packages/ucsschool/importer/utils/username_handler.py", line 143, in modify
    [("ucsschoolUsernameNextNumber", str(old_value), str(new_value))],
  File "/usr/lib/python2.7/dist-packages/univention/admin/uldap.py", line 891, in modify
    return self.lo.modify(dn, changes, serverctrls=serverctrls, response=response, rename_callback=rename_callback)
  File "/usr/lib/python2.7/dist-packages/univention/uldap.py", line 207, in _decorated
    return func(self, *args, **kwargs)
TypeError: modify() got an unexpected keyword argument 'rename_callback'

Mögliche Lösung:

Beim Update auf eine neuere Python-Version wurden die Python-Cache-Files nicht erneuert.
Eine mögliche Lösung ist das Update der Python-Module sowie anschließend der Neustart des Celery-Workers:

root@example:~# update-python-modules -a
root@example:~# systemctl stop celery-worker-ucsschool-import.service
root@example:~# systemctl start celery-worker-ucsschool-import.service
root@example:~#
1 Like
Mastodon