Univention Bugzilla – Bug 48551
udm/layout (groups/group): AttributeError: 'Group' object has no attribute 'append'
Last modified: 2019-06-03 10:03:04 CEST
Version: 4.3-3 errata410 (Neustadt) Remark: add a custum attribute with udm without errors Internal server error during "udm/layout (groups/group)". Request: udm/layout (groups/group) Traceback (most recent call last): File "%PY2.7%/univention/management/console/base.py", line 253, in execute function.__func__(self, request, *args, **kwargs) File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 117, in _decoarated ret = [func(self, request) for request.options in options] File "%PY2.7%/univention/management/console/modules/decorators.py", line 192, in _response return function(self, request) File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 831, in layout module.load(force_reload=True) # reload for instant extended attributes File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 267, in load self.module = _module_cache.get(module, force_reload=force_reload) File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 84, in _decorated return method(*args, **kwargs) File "%PY2.7%/univention/management/console/ldap.py", line 143, in _decorated result = func(*args, **kwargs) File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 236, in get udm_modules.init(ldap_connection, ldap_position, self[name], template_object, force_reload=force_reload) File "%PY2.7%/univention/admin/modules.py", line 140, in init update_extended_attributes(lo, module, position) File "%PY2.7%/univention/admin/modules.py", line 513, in update_extended_attributes item.append(ea_layout.label) AttributeError: 'Group' object has no attribute 'append' Role: domaincontroller_master
*** Bug 24987 has been marked as a duplicate of this bug. ***
Reproducible: eval "$(ucr shell)" udm settings/extended_attribute create \ --position "cn=custom attributes,cn=univention,$ldap_base" \ --set name=testProperty1 \ --set objectClass=univentionFreeAttributes \ --set ldapMapping=univentionFreeAttribute1 \ --set module=users/user \ --set tabName=Account \ --set groupName=Windows \ --set overwritePosition=Windows \ --set shortDescription="Test Field 1" If that occurrs, the whole UDM is not usable anymore: # udm users/user list Traceback (most recent call last): File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 218, in doit output = univention.admincli.admin.doit(arglist) File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 408, in doit out = _doit(arglist) File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 623, in _doit univention.admin.modules.init(lo, position, module) File "/usr/lib/pymodules/python2.7/univention/admin/modules.py", line 140, in init update_extended_attributes(lo, module, position) File "/usr/lib/pymodules/python2.7/univention/admin/modules.py", line 537, in update_extended_attributes item.append(ea_layout.label) AttributeError: 'Group' object has no attribute 'append'
Patch available in fbest/48551-extended-attribute-layout. diff --git a/management/univention-directory-manager-modules/modules/univention/admin/modules.py b/management/univention-directory-manager-modules/modules/univention/admin/modules.py index 66d21b06d7..25d8a805ef 100644 --- a/management/univention-directory-manager-modules/modules/univention/admin/modules.py +++ b/management/univention-directory-manager-modules/modules/univention/admin/modules.py @@ -537 +537 @@ def update_extended_attributes(lo, module, position): -» » » » » » » » » item.append(ea_layout.label) +» » » » » » » » » item.layout.append(ea_layout.label)
The bug has been introduced by Bug #23988: commit d56dd9692197b6acb4d7961627a7017c41a04b2a Date: Mon Oct 17 15:22:54 2011 +0000 EA_Layout never had a .layout attribute. One of the errors back then has been fixed by Bug #28629 but they missed the second/this error. commit 26fddab7d000118025e3fafda7a834c70b5b7249 Date: Wed Oct 30 13:29:18 2013 +0000
Hi! We ran into the same problem in a customer environment with UCS 4.4-0 Errata 5. We tried the proposed patch, but this resulted in a new error message, until we changed the line to +» » » » » » » » » item.layout.append(ea_layout.name) We haven't done an in-depth code analysis, it was more of a guess. Could this work or have we created a possible new problem?
(In reply to Andreas Burkert from comment #5) > Hi! > > We ran into the same problem in a customer environment with UCS 4.4-0 Errata > 5. We tried the proposed patch, but this resulted in a new error message, > until we changed the line to > > +» » » » » » » » » item.layout.append(ea_layout.name) > > We haven't done an in-depth code analysis, it was more of a guess. Could > this work or have we created a possible new problem? Oups, your line is the correct one. I did copy my old patch.
Reported again: Version: 4.4-0 errata0 (Blumenthal) - UCS@school 4.4 v1 Internal server error during "schoolexam/exam/start". Request: schoolexam/exam/start Traceback (most recent call last): File "%PY2.7%/univention/management/console/base.py", line 253, in execute function.__func__(self, request, *args, **kwargs) File "%PY2.7%/univention/management/console/modules/decorators.py", line 192, in _response return function(self, request) File "%PY2.7%/univention/management/console/modules/decorators.py", line 636, in _decorated return function(self, request, *args, **kwargs) File "%PY2.7%/ucsschool/lib/schoolldap.py", line 145, in wrapper_func return func(*args, **kwargs) File "%PY2.7%/univention/management/console/modules/schoolexam/__init__.py", line 188, in start_exam sender = util.distribution.openRecipients(self.user_dn, ldap_user_read) File "%PY2.7%/univention/management/console/modules/distribution/util.py", line 199, in openRecipients user = ucsschool.lib.models.User.from_dn(entryDN, None, ldap_connection) File "%PY2.7%/ucsschool/lib/models/base.py", line 914, in from_dn cls.init_udm_module(lo) File "%PY2.7%/ucsschool/lib/models/base.py", line 776, in init_udm_module udm_modules.init(lo, pos, udm_modules.get(cls._meta.udm_module)) File "%PY2.7%/univention/admin/modules.py", line 140, in init update_extended_attributes(lo, module, position) File "%PY2.7%/univention/admin/modules.py", line 537, in update_extended_attributes item.append(ea_layout.label) AttributeError: 'Group' object has no attribute 'append' Role: domaincontroller_master
The patch has been applied. univention-directory-manager-modules (14.0.12-20) 1a0e6f57e1df | Bug #48551: fix extended attribute layout when group is not available univention-directory-manager-modules.yaml 9762eb559436 | YAML Bug #48551
730de16 Bug #48551: adjust wording in yaml I made a slight enhancement to the wording of the yaml. traceback doesn't appear - OK yaml - OK installation - OK
<http://errata.software-univention.de/ucs/4.4/50.html>
*** Bug 49570 has been marked as a duplicate of this bug. ***