Bug 28145 - Traceback beim Anlegen einer Gruppe ohne Option Posix und ohne Option Samba
Traceback beim Anlegen einer Gruppe ohne Option Posix und ohne Option Samba
Status: RESOLVED DUPLICATE of bug 41580
Product: UCS
Classification: Unclassified
Component: UMC - Groups
UCS 3.0
Other Linux
: P5 normal (vote)
: UCS 4.0-x
Assigned To: UMC maintainers
:
: 25278 29678 37561 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-06 10:48 CEST by Arvid Requate
Modified: 2018-04-13 13:28 CEST (History)
6 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling, External feedback
Max CVSS v3 score:
best: Patch_Available+


Attachments
Fix missing objectClasses (7.58 KB, patch)
2014-03-11 13:42 CET, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2012-08-06 10:48:55 CEST
Traceback beim Anlegen einer Gruppe ohne Option Posix und ohne Option Samba:

============================================================================
  File '/usr/lib/pymodules/python2.6/notifier/threads.py', line 82, in _run
    tmp = self._function()
  File '/usr/lib/pymodules/python2.6/notifier/__init__.py', line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File '/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/__init__.py', line 267, in _thread
    dn = module.create( properties, container = options.get( 'container' ), superordinate = options.get( 'superordinate' ) )
  File '/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py', line 139, in wrapper_func
    ret = func( *args, **kwargs )
  File '/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py', line 321, in create
    obj.create()
  File '/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py', line 332, in create
    return self._create()
  File '/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py', line 603, in _create
    self._ldap_pre_create()
  File '/usr/lib/pymodules/python2.6/univention/admin/handlers/groups/group.py', line 503, in _ldap_pre_create
    self.dn='%s=%s,%s' % (mapping.mapName('name'), mapping.mapValue('name', self.info['name']), self.position.getDn())

KeyError: 'name'
============================================================================
Comment 1 Stefan Gohmann univentionstaff 2013-10-13 20:55:26 CEST
*** Bug 29678 has been marked as a duplicate of this bug. ***
Comment 2 Lukas Walter univentionstaff 2013-11-06 16:21:29 CET
*** Bug 25278 has been marked as a duplicate of this bug. ***
Comment 3 Philipp Hahn univentionstaff 2014-03-11 13:42:38 CET
Created attachment 5826 [details]
Fix missing objectClasses

Again.

A group without at leas a name is not very practical, so always show the name.

Without POSIX and Samba, the object has no STRUCTURAL objectClass. The Samba case already just uses "organizationalRole", as this objectClass is structural and has 'cn' as a MUST attribute.

Also "gidNumber" is stored unconditionally, which requires at least POSIX or samba.
Comment 4 Florian Best univentionstaff 2014-03-11 15:40:55 CET
(In reply to Philipp Hahn from comment #3)
> Created attachment 5826 [details]
> Fix missing objectClasses

> -			self['users']=self['hosts']=self['nestedGroup']=[]
> +			self['users'] = []
> +			self['hosts'] = []
> +			self['nestedGroup'] = []
→ Are you sure about this? The old behavior was that all of the keys are the same list/reference. Now they are 3 different lists.
Comment 5 Philipp Hahn univentionstaff 2014-03-11 15:51:48 CET
(In reply to Florian Best from comment #4)
> (In reply to Philipp Hahn from comment #3)
> > Created attachment 5826 [details]
> > Fix missing objectClasses
> 
> > -			self['users']=self['hosts']=self['nestedGroup']=[]
> > +			self['users'] = []
> > +			self['hosts'] = []
> > +			self['nestedGroup'] = []
> → Are you sure about this? The old behavior was that all of the keys are the
> same list/reference. Now they are 3 different lists.

That was exactly what confused me too, as the original version looks totally bogus: The whole logic in groups/groups would be pointless, as it tries to partition the members of the group into users, sub-groups and hosts. It only looks like the 3 properties all reference the same list, but only through adding debugging output you see that this isn't true.

It is only through the (confusing) implementation of univention.admin.handler.__init__.py # base.__setitem__ that it works: there in line 232 through »self.info[key]=[]« the property is always initialized with a new list into which the elements are appended.
Comment 6 Florian Best univentionstaff 2015-04-23 10:54:31 CEST
Reported as traceback feedback, 4.0-1 errata160 (Walle).

Die Ausführung des Kommandos udm/add groups/group ist fehlgeschlagen:

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/modules/__init__.py", line 176, in _decorated
    return function(self, request, *args, **kwargs)
  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 374, in _thread
    dn = module.create(properties, container=options.get('container'), superordinate=options.get('superordinate'))
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 163, in _decorated
    return func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 146, in wrapper_func
    return _func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 139, in _func
    ret = func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 491, in create
    obj.create()
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 352, in create
    return self._create()
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 685, in _create
    self._ldap_pre_create()
  File "%PY2.7%/univention/admin/handlers/groups/group.py", line 529, in _ldap_pre_create
    self.dn='%s=%s,%s' % (mapping.mapName('name'), mapping.mapValue('name', self.info['name']), self.position.getDn())
KeyError: 'name'
Comment 7 Florian Best univentionstaff 2015-04-23 10:56:17 CEST
*** Bug 37561 has been marked as a duplicate of this bug. ***
Comment 8 Florian Best univentionstaff 2015-04-23 10:57:34 CEST
(In reply to Florian Best from comment #7)
> *** Bug 37561 has been marked as a duplicate of this bug. ***
Tagging to the TM of that duplicate.

Patch_available from Philipp is at comment #3.
Comment 9 Florian Best univentionstaff 2016-02-15 13:16:29 CET
Reported again, 4.0-4 errata399 (Walle)

Remark:
Der Fehler ist direkt nach der Installation beim Anlegen einer neuen Gruppe aufgetreten.
Comment 10 Florian Best univentionstaff 2016-06-21 09:58:44 CEST
This is part of svn r70450.

*** This bug has been marked as a duplicate of bug 41580 ***