Bug 41899 - Initial setup of extended attribute doesn't work for complex syntax
Initial setup of extended attribute doesn't work for complex syntax
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM - Extended Attributes
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-3-errata
Assigned To: Florian Best
Stefan Gohmann
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-02 18:26 CEST by Michel Smidt
Modified: 2021-01-08 13:37 CET (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary 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.091
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:
best: Patch_Available+


Attachments
patch (943 bytes, patch)
2016-08-15 13:32 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Smidt 2016-08-02 18:26:18 CEST
- Installed Version: UCS 4.1-2 errata220
- Seems to work at least until: UCS 4.1-1 errata 121 (according to Erik)
- Installed cool solution "Quota": http://wiki.univention.de/index.php?title=Cool_Solution_-_Manage_Userquota_in_the_Domain-LDAP
- Only failing during initial save. Added initial value with ldap_modify and afterwards all went fine. Modify etc.
- Failed in UDM and UMC
- Maybe related to Bug 23981.
- Got traceback when I try to initially save a extended attribute (quota):

Execution of command 'udm/put users/user' has failed:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "/usr/lib/pymodules/python2.7/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/__init__.py", line 402, in _thread
    module.modify(properties)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/udm_ldap.py", line 85, in _decorated
    return method(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/univention/management/console/ldap.py", line 135, in _decorated
    result = func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/udm_ldap.py", line 441, in modify
    obj.modify()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/users/user.py", line 1564, in modify
    return super(object, self).modify(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 361, in modify
    return self._modify(modify_childs,ignore_license=ignore_license)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 769, in _modify
    ml = self._ldap_object_classes(ml)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 824, in _ldap_object_classes
    newattr = ldap.cidict.cidict(_MergedAttributes(self, ml).get_attributes())
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 2821, in get_attributes
    return dict((attr, self.get_attribute(attr)) for attr in attributes)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 2821, in <genexpr>failed
    return dict((attr, self.get_attribute(attr)) for attr in attributes)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 2832, in get_attribute
    values |= set(new)
TypeError: unhashable type: 'list'

Log (/var/log/univention/directory-manager-cmd.log) show following:
02.08.16 18:14:47.094  ADMIN       ( INFO    ) : layout overwrite: tab_descr='None'
02.08.16 18:14:47.094  ADMIN       ( INFO    ) : ucr_overwrite_module_layout: trying to hide properties on tab Certificate
02.08.16 18:14:47.095  ADMIN       ( INFO    ) : layout overwrite: tab_layout='None'
02.08.16 18:14:47.095  ADMIN       ( INFO    ) : layout overwrite: tab_name='None'
02.08.16 18:14:47.095  ADMIN       ( INFO    ) : layout overwrite: tab_descr='None'
02.08.16 18:14:47.095  ADMIN       ( INFO    ) : ucr_overwrite_module_layout: trying to hide properties on tab Windows terminal server
02.08.16 18:14:47.096  ADMIN       ( INFO    ) : layout overwrite: tab_layout='None'
02.08.16 18:14:47.096  ADMIN       ( INFO    ) : layout overwrite: tab_name='None'
02.08.16 18:14:47.096  ADMIN       ( INFO    ) : layout overwrite: tab_descr='None'
02.08.16 18:14:47.096  ADMIN       ( INFO    ) : ucr_overwrite_module_layout: trying to hide properties on tab UCS@school
02.08.16 18:14:47.097  ADMIN       ( INFO    ) : layout overwrite: tab_layout='None'
02.08.16 18:14:47.097  ADMIN       ( INFO    ) : layout overwrite: tab_name='None'
02.08.16 18:14:47.097  ADMIN       ( INFO    ) : layout overwrite: tab_descr='None'
02.08.16 18:14:47.097  ADMIN       ( INFO    ) : ucr_overwrite_module_layout: trying to hide properties on tab DB
02.08.16 18:14:47.098  ADMIN       ( INFO    ) : layout overwrite: tab_layout='None'
02.08.16 18:14:47.098  ADMIN       ( INFO    ) : layout overwrite: tab_name='None'
02.08.16 18:14:47.098  ADMIN       ( INFO    ) : layout overwrite: tab_descr='None'
02.08.16 18:14:47.098  ADMIN       ( INFO    ) : ucr_overwrite_module_layout: trying to hide properties on tab Quota
02.08.16 18:14:47.101  ADMIN       ( INFO    ) : open: module:<univention.admin.handlers.users.user.object object at 0x3207b10>
02.08.16 18:14:47.102  LDAP        ( INFO    ) : uldap.search filter=(&(cn=*)(|(objectClass=univentionGroup)(objectClass=sambaGroupMapping))(uniqueMember=uid=tquota2,cn=schueler,cn=users,ou=QuotaTest,dc=schulen-fulda,dc=intranet)) base= scope=sub attr=['dn'] unique=0 required=0 timeout=-1 sizelimit=0
02.08.16 18:14:47.102  LDAP        ( INFO    ) : uldap.search filter=(&(cn=*)(|(objectClass=posixGroup)(objectClass=sambaGroupMapping))(gidNumber=7923)) base= scope=sub attr=['dn'] unique=0 required=0 timeout=-1 sizelimit=0
02.08.16 18:14:47.103  ADMIN       ( INFO    ) : syntax.py: self.subsyntax[0] is ('Host', <class 'univention.admin.syntax.UCS_Server'>), texts is ['ucs-fileserver.usc-school.intranet', '/', '500', 'MiB']
02.08.16 18:14:47.104  ADMIN       ( INFO    ) : syntax.py: self.subsyntax[1] is ('Path', <class 'univention.admin.syntax.OneThirdAbsolutePath'>), texts is ['ucs-fileserver.usc-school.intranet', '/', '500', 'MiB']
02.08.16 18:14:47.104  ADMIN       ( INFO    ) : syntax.py: self.subsyntax[2] is ('Quota', <class 'univention.admin.syntax.OneThirdInteger'>), texts is ['ucs-fileserver.usc-school.intranet', '/', '500', 'MiB']
02.08.16 18:14:47.104  ADMIN       ( INFO    ) : syntax.py: self.subsyntax[3] is ('Unit', <class 'univention.admin.syntax.siprefix'>), texts is ['ucs-fileserver.usc-school.intranet', '/', '500', 'MiB']
02.08.16 18:14:47.104  ADMIN       ( INFO    ) : admin.syntax.hook.simpleHook: _ldap_pre_modify called
02.08.16 18:14:47.106  ADMIN       ( INFO    ) : simpleLdap._modify: extended attribute='objectFlag'  oc='univentionObject'
02.08.16 18:14:47.106  ADMIN       ( INFO    ) : simpleLdap._modify: extended attribute='serviceprovider'  oc='univentionSAMLEnabled'
02.08.16 18:14:47.106  ADMIN       ( INFO    ) : simpleLdap._modify: extended attribute='externalDBIdentifier'  oc='externalDB'
02.08.16 18:14:47.106  ADMIN       ( INFO    ) : simpleLdap._modify: extended attribute='externalDBPrimaryKey'  oc='externalDB'
02.08.16 18:14:47.106  ADMIN       ( INFO    ) : simpleLdap._modify: extended attribute='school'  oc='ucsschoolType'
02.08.16 18:14:47.106  ADMIN       ( INFO    ) : simpleLdap._modify: extended attribute='ucsschoolSourceUID'  oc='ucsschoolType'
02.08.16 18:14:47.106  ADMIN       ( INFO    ) : simpleLdap._modify: extended attribute='ucsschoolRecordUID'  oc='ucsschoolType'
02.08.16 18:14:47.106  ADMIN       ( INFO    ) : simpleLdap._modify: extended attribute='domainquota'  oc='domainquotauser'
02.08.16 18:14:47.107  ADMIN       ( INFO    ) : OCS=set(['krb5kdcentry', 'univentionsamlenabled', 'person', 'automount', 'top', 'inetorgperson', 'sambasamaccount', 'shadowaccount', 'organizationalperson', 'domainquotauser', 'univentionpwhistory', 'ucsschoolstudent', 'univentionobject', 'ucsschooltype', 'univentionmail', 'krb5principal', 'posixaccount']); required=set(['domainquotauser', 'ucsschoolType']); removed: set([])
02.08.16 18:14:47.345  ADMIN       ( INFO    ) : daemon [9850] connection closed [9855]
Comment 1 Erik Damrose univentionstaff 2016-08-02 18:30:43 CEST
I am not sure if this is an error with udm or if the package univention-domain-userquota simply has to be adjusted - note: the package was originally created for UCS 3.1 and has never (!) been adapted. Some change in UDM does however seem to cause it to fail.

branches/ucs-3.1/component/cool-solutions/univention-domain-userquota/
Comment 2 Michel Smidt 2016-08-08 09:18:06 CEST
Just to make it clear. I agree with Erik that I do not now exactly if it is a udm issue. Probably not. To me it seems like a change in the handling of complex types since UCS 4.1-1 errata 121.
But to categorize it as a "cool solution" bug seemed to me not appropriate as well. So, that's why I decided to categorize it as a udm bug. Feel free to change. 
Changed the title as well to make it explicit.
Comment 3 Michel Smidt 2016-08-08 09:23:39 CEST
The complex type is:
ldap: domainquota: ucs-fileserver.usc-school.intranet$$/$$200$$MiB

udm: Quota:
        Domain Quota Settings
                domainquota ([])                         Quota settings
domainquota: ucs-fileserver.usc-school.intranet / 200 MiB
Comment 4 Florian Best univentionstaff 2016-08-15 13:32:02 CEST
Created attachment 7867 [details]
patch

The "domainquota" property doesn't register a mapping-function but instead makes the mapping manually in the hook_ldap_modlist() - the modlist is therefore broken until the hook-function is called but we have code which expects the modlist to be correct. Rearranging the order fixes this. The rearrangement is probably also better.
Comment 5 Florian Best univentionstaff 2016-08-15 17:35:09 CEST
univention-directory-manager-modules (11.0.3-29):
r71611 | Bug #41899: execute hooks before adjusting object classes

univention-directory-manager-modules.yaml:
r71615 | YAML Bug #41824 Bug #41829 Bug #41899

UCS 4.2:
univention-directory-manager-modules (12.0.1-1):
r71608 | Bug #41899: execute hooks before adjusting object classes
Comment 6 Stefan Gohmann univentionstaff 2016-08-17 06:38:13 CEST
Code review: OK

YAML: OK

ucs-test: Waiting for Jenkins

Tests: ?

I'm currently testing with UCS 4.1-3errata234 and I'm unable to reproduce the issue like described in Comment 0. I've installed the Cool Solution and I've added a new user and set on the quota tab. I don't see any traceback.

(In reply to Michel Smidt from comment #0)
> - Installed cool solution "Quota":
> http://wiki.univention.de/index.php?title=Cool_Solution_-
> _Manage_Userquota_in_the_Domain-LDAP
> - Only failing during initial save. Added initial value with ldap_modify and
> afterwards all went fine. Modify etc.
> - Failed in UDM and UMC
> - Maybe related to Bug 23981.
> - Got traceback when I try to initially save a extended attribute (quota):

Any other hints how to reproduce the issue? BTW, I'm unable to reproduce it with the new version either.
Comment 7 Florian Best univentionstaff 2016-08-17 10:46:40 CEST
To reproduce this the quota settings as well as any option has to be changed.
Comment 8 Stefan Gohmann univentionstaff 2016-08-17 11:04:52 CEST
(In reply to Florian Best from comment #7)
> To reproduce this the quota settings as well as any option has to be changed.


Tests: OK, I was now able to reproduce it, thanks. It works with the new version.

ucs-test: OK
Comment 9 Janek Walkenhorst univentionstaff 2016-08-18 15:15:36 CEST
<http://errata.software-univention.de/ucs/4.1/235.html>