Univention Bugzilla – Bug 42364
primaryGroupUsed exception when removing a class
Last modified: 2022-11-03 12:11:36 CET
Version: 3.2-7 errata403 (Borgfeld) Remark: Habe versucht eine Klasse zu löschen allerdings kommt eine Fehlermeldung Die Ausführung des Kommandos schoolwizards/classes/remove ist fehlgeschlagen: Traceback (most recent call last): File "%PY2.6%/univention/management/console/modules/__init__.py", line 218, in execute func( request ) File "%PY2.6%/ucsschool/lib/schoolldap.py", line 204, in wrapper_func return func( *args, **kwargs ) File "%PY2.6%/univention/management/console/modules/schoolwizards/__init__.py", line 118, in _decorated ret = func(self, request, *a, **kw) File "%PY2.6%/univention/management/console/modules/schoolwizards/__init__.py", line 233, in _delete_obj if obj.remove(ldap_admin_write): File "%PY2.6%/ucsschool/lib/models/base.py", line 501, in remove success = self.remove_without_hooks(lo) File "%PY2.6%/ucsschool/lib/models/group.py", line 164, in remove_without_hooks success = super(SchoolClass, self).remove_without_hooks(lo) File "%PY2.6%/ucsschool/lib/models/base.py", line 511, in remove_without_hooks udm_obj.remove(remove_childs=True) File "%PY2.6%/univention/admin/handlers/__init__.py", line 528, in remove return self._remove(remove_childs) File "%PY2.6%/univention/admin/handlers/__init__.py", line 1000, in _remove self._ldap_pre_remove() File "%PY2.6%/univention/admin/handlers/groups/group.py", line 735, in _ldap_pre_remove raise univention.admin.uexceptions.primaryGroupUsed primaryGroupUsed
This can only happen if a user uses the class group as primary group. Workaround: do not use class groups as primary group!
(In reply to Sönke Schwardt-Krummrich from comment #1) > This can only happen if a user uses the class group as primary group. Why do you think so? From my perspective this can have several causes: * No LDAP read permissions * Group not yet replicated * Any other primary-group * Deleted primary group * (LDAP timing/connection Errors during the search?)
(In reply to Florian Best from comment #2) > (In reply to Sönke Schwardt-Krummrich from comment #1) > > This can only happen if a user uses the class group as primary group. > Why do you think so? File "%PY2.6%/univention/admin/handlers/groups/group.py", line 735, in _ldap_pre_remove checks if there are still users in LDAP that use the group to be deleted as primary group. The UMCP command called here is schoolwizards/classes/remove so the UDM refuses to erase the group because it is still used. > From my perspective this can have several causes: > * No LDAP read permissions The exception is only raised if a user is found for the to-be-deleted group is found → so I don't think that this may be a reason > * Group not yet replicated The group is about to be deleted. So it exists. > * Any other primary-group ? > * Deleted primary group ? > * (LDAP timing/connection Errors during the search?) Possible but unlikely. I'm not 100% sure, but did you meant bug 42080? In this case your objections would be correct. (Btw: exactly the exception of this bug should prevent the point "Deleted primary group" and the inconsistency arising from a deleted primary group).
Oh yes, sorry.
This issue has been filled against UCS@school 3. The maintenance with bug and security fixes for the last UCS@school version for UCS 3.x (→ UCS@school 3.2) has ended on Dec 31, 2016. Customers still on UCS 3.x are encouraged to update to UCS 4.3 (or later). Please contact your partner or Univention for any questions. If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.
*** Bug 55353 has been marked as a duplicate of this bug. ***
Version: 4.1-5 errata502 (Vahr) Error: Die Ausführung des Kommandos schoolwizards/classes/remove schoolwizards/classes ist fehlgeschlagen: Traceback (most recent call last): File "%PY2.7%/univention/management/console/base.py", line 281, in execute function(self, request) File "%PY2.7%/univention/management/console/modules/decorators.py", line 190, in _response return function(self, request) File "%PY2.7%/univention/management/console/modules/schoolwizards/__init__.py", line 122, in _decorated ret = func(self, request, *a, **kw) File "%PY2.7%/ucsschool/lib/schoolldap.py", line 145, in wrapper_func return func(*args, **kwargs) File "%PY2.7%/univention/management/console/modules/schoolwizards/__init__.py", line 256, in _delete_obj if obj.remove(ldap_user_write): File "%PY2.7%/ucsschool/lib/models/base.py", line 590, in remove success = self.remove_without_hooks(lo) File "%PY2.7%/ucsschool/lib/models/group.py", line 222, in remove_without_hooks success = super(SchoolClass, self).remove_without_hooks(lo) File "%PY2.7%/ucsschool/lib/models/base.py", line 600, in remove_without_hooks udm_obj.remove(remove_childs=True) File "%PY2.7%/univention/admin/handlers/__init__.py", line 475, in remove return self._remove(remove_childs) File "%PY2.7%/univention/admin/handlers/__init__.py", line 952, in _remove self._ldap_pre_remove() File "%PY2.7%/univention/admin/handlers/groups/group.py", line 699, in _ldap_pre_remove raise univention.admin.uexceptions.primaryGroupUsed primaryGroupUsed