Bug 44899 - UCS@school import crashes with: valueError: OX Display name "…" is already in use.
UCS@school import crashes with: valueError: OX Display name "…" is already in...
Status: NEW
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-29 15:42 CEST by Florian Best
Modified: 2020-07-14 10:58 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 7: Crash: Bug causes crash or data loss
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.200
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 Florian Best univentionstaff 2017-06-29 15:42:55 CEST
When a user which already exists is going to be modified the importer crashes after the first user with the following error:

2017-06-29 15:40:43 ERROR cmdline.main:137  Outer Exception catcher: valueError('OX Display name "Ylang Muestermann" is already in use.',)
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/frontend/cmdline.py", line 117, in main
    self.do_import()
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/frontend/cmdline.py", line 95, in do_import
    importer.mass_import()
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/mass_import/mass_import.py", line 70, in mass_import
    self.import_users()
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/mass_import/mass_import.py", line 99, in import_users
    user_import.create_and_modify_users(imported_users)
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/mass_import/user_import.py", line 143, in create_and_modify_users
    success = user.modify(lo=self.connection)
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 541, in modify
    return super(ImportUser, self).modify(lo, validate, move_if_necessary)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 481, in modify
    success = self.modify_without_hooks(lo, validate, move_if_necessary)
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 549, in modify_without_hooks
    return super(ImportUser, self).modify_without_hooks(lo, validate, move_if_necessary)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 504, in modify_without_hooks
    self.do_modify(udm_obj, lo)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/user.py", line 297, in do_modify
    return super(User, self).do_modify(udm_obj, lo)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 530, in do_modify
    udm_obj.modify(ignore_license=1)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/users/user.py", line 1656, in modify
    return super(object, self).modify(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 324, in modify
    return self._modify(modify_childs, ignore_license=ignore_license)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 806, in _modify
    self.call_udm_property_hook('hook_ldap_pre_modify', self)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 655, in call_udm_property_hook
    func(module)
  File "/usr/lib/pymodules/python2.7/univention/admin/hooks.d/oxAccess.py", line 195, in hook_ldap_pre_modify
    self.check_displayname(module)
  File "/usr/lib/pymodules/python2.7/univention/admin/hooks.d/oxAccess.py", line 117, in check_displayname
    raise univention.admin.uexceptions.valueError(oxAccess._('OX Display name "%s" is already in use.') % oxDisplayName)
valueError: OX Display name "Ylang Muestermann" is already in use.
Comment 1 Florian Best univentionstaff 2017-06-29 16:26:46 CEST
udm users/user list | grep oxDisplayName
  oxDisplayName:  Administrator
  oxDisplayName:  Joinuser
  oxDisplayName:  Joinuser
  oxDisplayName: OX Admin
  oxDisplayName:  none
  oxDisplayName:  none
  oxDisplayName:  none
  oxDisplayName:  Service
  oxDisplayName: test test
  oxDisplayName: test test
  oxDisplayName: ?lang Muestermann
  oxDisplayName: ?lang Muestermann
  oxDisplayName: ?lang Muestermann
  oxDisplayName: ?lang Muestermann
  oxDisplayName: ?lang Muestermann

Probably this is an error in the OX hook script in combination with the UCS@school importer which creates multiple objects at once? As far as I can see the OX display name must be unique in the LDAP?! This is not the case after a regular UCS@school import. The checks are maybe executed all after another before the objects are created.
Comment 2 Florian Best univentionstaff 2017-06-29 16:27:44 CEST
It prevents running any import after the first initial import.
Comment 3 Daniel Tröder univentionstaff 2017-06-29 17:40:19 CEST
In a UCS@school environment the default value for oxDisplayName should contain the username, which is unique.

Changing the default value for oxDisplayName should be added to the ucs-school-ox-support package.