Bug 42364 - primaryGroupUsed exception when removing a class
primaryGroupUsed exception when removing a class
Status: REOPENED
Product: UCS@school
Classification: Unclassified
Component: UMC - Wizards
UCS@school 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
:
: 55353 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-09-13 11:40 CEST by Florian Best
Modified: 2022-11-03 12:11 CET (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very 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.034
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2022102021000425
Bug group (optional): Error handling, External feedback
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-09-13 11:40:15 CEST
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
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2016-10-13 14:40:37 CEST
This can only happen if a user uses the class group as primary group.

Workaround: do not use class groups as primary group!
Comment 2 Florian Best univentionstaff 2016-10-13 14:47:38 CEST
(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?)
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2016-10-17 10:01:32 CEST
(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).
Comment 4 Florian Best univentionstaff 2016-10-17 11:06:51 CEST
Oh yes, sorry.
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2019-02-05 21:50:14 CET
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.
Comment 6 Florian Best univentionstaff 2022-11-03 12:10:36 CET
*** Bug 55353 has been marked as a duplicate of this bug. ***
Comment 7 Florian Best univentionstaff 2022-11-03 12:11:36 CET
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