Bug 41802 - Unknown object class prevents modifying user
Unknown object class prevents modifying user
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.2-1-errata
Assigned To: Johannes Keiser
Florian Best
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-07-15 11:51 CEST by Florian Best
Modified: 2017-08-04 16:12 CEST (History)
2 users (show)

See Also:
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?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.114
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2016100821000442, 2016101621000141, 2016073121000628, 2016071421000562, 2016121321000652, 2016120221000333, 2017031321000293, 2017072021000478, 2017072821000472
Bug group (optional): Error handling, External feedback, Usability
Max CVSS v3 score:
best: Patch_Available+


Attachments
patch (848 bytes, patch)
2017-01-05 13:55 CET, 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 2016-07-15 11:51:43 CEST
We received the following traceback:

Version: 4.1-2 errata209 (Vahr)

Die Ausführung des Kommandos udm/put users/user ist fehlgeschlagen:

Traceback (most recent call last):
  File "%PY2.7%/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "%PY2.7%/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 402, in _thread
    module.modify(properties)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 85, in _decorated
    return method(*args, **kwargs)
  File "%PY2.7%/univention/management/console/ldap.py", line 135, in _decorated
    result = func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 441, in modify
    obj.modify()
  File "%PY2.7%/univention/admin/handlers/users/user.py", line 1517, in modify
    return super(object, self).modify(*args, **kwargs)
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 307, in modify
    return self._modify(modify_childs,ignore_license=ignore_license)
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 770, in _modify
    ml = self._ldap_object_classes(ml)
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 832, in _ldap_object_classes
    ocs = set(schema.get_obj(ldap.schema.models.ObjectClass, x).names[0] for x in ocs)
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 832, in <genexpr>
    ocs = set(schema.get_obj(ldap.schema.models.ObjectClass, x).names[0] for x in ocs)
AttributeError: 'NoneType' object has no attribute 'names'
Comment 1 Florian Best univentionstaff 2016-08-15 15:51:48 CEST
Reported again, 4.1-2 errata220 (Vahr)
Comment 2 Florian Best univentionstaff 2016-10-10 11:21:23 CEST
Reported again, 4.1-3 errata282 (Vahr)
Comment 3 Florian Best univentionstaff 2016-10-25 15:39:49 CEST
Reported again, 4.1-3 errata292 (Vahr)

It was always reported by the same UUID.
Comment 4 Dirk Wiesenthal univentionstaff 2016-12-18 21:46:07 CET
Stumbled over it. Set the "LDAP object class" of an extended attribute to a non-existing class name.

Arguably a user error and will hardly happen in non-dev environments. Still, the error message is a bit vague, the extended attribute is invalid, but you can save it.

Introduced with Bug#41207?
Comment 5 Florian Best univentionstaff 2016-12-20 11:53:46 CET
(In reply to Dirk Wiesenthal from comment #4)
> Stumbled over it. Set the "LDAP object class" of an extended attribute to a
> non-existing class name.
Thank you! :)

> Arguably a user error and will hardly happen in non-dev environments. Still,
> the error message is a bit vague, the extended attribute is invalid, but you
> can save it.
How should we handle this? A user friendly error message? Or ignoring the object class and print a warning to the logfile?

> Introduced with Bug#41207?
I don't think so. Well, yes now there is a traceback while prior would have been a simple error message: "LDAP Error: Unknown object class: foo".
Comment 6 Florian Best univentionstaff 2016-12-20 12:27:52 CET
Reported again, 4.1-4 errata353 (Vahr)
Comment 7 Florian Best univentionstaff 2017-01-05 13:55:14 CET
Created attachment 8334 [details]
patch

The patch restores the previous behavior. Instead of a traceback is shown the error message "The LDAP object could not be saved: LDAP Error Undefined attribute type: foobar: attribute type undefined" is shown.
Comment 8 Florian Best univentionstaff 2017-02-22 16:26:32 CET
It seems the univentionFreeAttributes[1-10] attributes are sometimes entered as object class when adding a extended attribute. This leads to this error. We should in that case print a human readable error message explaining the situation.
Comment 10 Florian Best univentionstaff 2017-04-21 11:43:11 CEST
Version: 4.1-4 errata406 (Vahr)

Remark: öffnen eines Bestehenden Users in der Benutzerverwaltungund speichern ohne änderung
Comment 11 Johannes Keiser univentionstaff 2017-06-29 16:15:36 CEST
(In reply to Florian Best from comment #7)
> Created attachment 8334 [details]
> patch
> 
> The patch restores the previous behavior. Instead of a traceback is shown
> the error message "The LDAP object could not be saved: LDAP Error Undefined
> attribute type: foobar: attribute type undefined" is shown.

Applied patch:

r 80628
univention-directory-manager-modules (12.0.17-27) 
* Bug #41802: Applied patch from Folrian Best - Show error message instead
of a traceback when saving an extended attribute with non-existing LDAP
object class

YAML: r 80636
Comment 12 Florian Best univentionstaff 2017-06-29 17:18:40 CEST
OK: the error message is now more clear
OK: YAML (adjusted in r80648)
Comment 13 Janek Walkenhorst univentionstaff 2017-07-05 13:06:28 CEST
<http://errata.software-univention.de/ucs/4.2/79.html>
Comment 14 Florian Best univentionstaff 2017-07-20 17:16:52 CEST
Reported again, 4.2-0 errata29 (Lesum)

Remark: Created a custom field as described here (http://docs.software-univention.de/manual-4.2.html#central:extendedattrs). Went to user page to add info to that field, and got
the error message you see here. Please advise. Thank you.
Comment 15 Florian Best univentionstaff 2017-08-04 16:12:52 CEST
Reported again, 4.1-4 errata439 (Vahr)