Bug 34970 - Working groups with alien students have issues
Working groups with alien students have issues
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Classes / Teachers / Workgroup assignment
UCS@school 3.2 R2
Other Linux
: P5 normal (vote)
: UCS@school 4.0 Errata
Assigned To: Florian Best
Sönke Schwardt-Krummrich
:
: 18784 (view as bug list)
Depends on:
Blocks: 37764
  Show dependency treegraph
 
Reported: 2014-05-26 14:48 CEST by Dirk Wiesenthal
Modified: 2015-12-02 10:34 CET (History)
7 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:
Ticket number:
Bug group (optional): Error handling, External feedback
Max CVSS v3 score:


Attachments
Catch noObject exception (1.05 KB, patch)
2015-02-18 16:28 CET, Sönke Schwardt-Krummrich
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2014-05-26 14:48:30 CEST
Multi Server setup: If you manage working groups on the master, you can choose to add OU1's students to OU2's working group.

This _may_ be useful, e.g. when schools work together to form a "Leistungskurs".

Anyway, opening this working group on the slave yields

Die Ausführung des Kommandos schoolgroups/get ist fehlgeschlagen:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py", line 204, in execute
    func( request )
  File "/usr/lib/pymodules/python2.6/ucsschool/lib/schoolldap.py", line 204, in wrapper_func
    return func( *args, **kwargs )
  File "/usr/lib/pymodules/python2.6/univention/management/console/modules/schoolgroups/__init__.py", line 173, in get
    user.open()
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/users/user.py", line 1424, in open
    self['primaryGroup']=None
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 215, in __setitem__
    raise univention.admin.uexceptions.valueRequired, _('The property %s is required') % self.descriptions[key].short_description
valueRequired: Die Eigenschaft Primäre Gruppe wird benötigt.
Comment 1 Florian Best univentionstaff 2014-12-01 10:07:44 CET
That traceback and the following were reported via traceback feedback:
It prevents searching for users.

Traceback:
Die Ausführung des Kommandos schoolusers/query ist fehlgeschlagen:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py",
line 218, in execute
    func( request )
  File "/usr/lib/pymodules/python2.6/ucsschool/lib/schoolldap.py", line 204, in
wrapper_func
    return func( *args, **kwargs )
  File
"/usr/lib/pymodules/python2.6/univention/management/console/modules/schoolusers/__init__.py",
line 77, in query
    result = self._users( ldap_user_read, search_base, group = klass, user_type =
request.flavor, pattern = request.options.get( 'pattern', '' ) )
  File "/usr/lib/pymodules/python2.6/ucsschool/lib/schoolldap.py", line 637, in _users
    userObj.open()
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/users/user.py", line 1456,
in open
    self['primaryGroup']=None
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 234, in
__setitem__
    raise univention.admin.uexceptions.valueRequired, _('The property %s is required') %
self.descriptions[key].short_description
valueRequired: Die Eigenschaft Primäre Gruppe wird benötigt.
Comment 2 Florian Best univentionstaff 2014-12-01 10:09:29 CET
Aus users/user.py

primaryGroupNumber=self.oldattr.get('gidNumber',[''])[0]
if primaryGroupNumber:
  # hier will man rein
else:
  # erzeugt wohl immer einen Traceback? Wenn ja, dann keine Ahnung, wozu der Pfad gut sein soll

=> Vielleicht PrimaryGroup gelöscht?
Comment 3 Florian Best univentionstaff 2014-12-05 11:07:16 CET
Maybe user without posix option? See Bug #37119
Comment 4 Alexander Kläser univentionstaff 2014-12-12 12:38:01 CET
FYI, I saw the same tracebacks in the USI tarball at Ticket #2014110221000053. The information there may help to better understand the problem.
Comment 5 Alexander Kläser univentionstaff 2014-12-12 13:00:20 CET
(In reply to Florian Best from comment #1)
> ...
> valueRequired: Die Eigenschaft Primäre Gruppe wird benötigt.

Running the following script on a DC master...
-------------------- 8< --------------------
import univention.admin.modules as udm_modules
import univention.admin.uldap as udm_uldap
import univention.admin.objects as udm_obj
import univention.config_registry as ucr
udm_modules.update()
c = ucr.ConfigRegistry()
c.load()
lo, po = udm_uldap.getAdminConnection()
module = udm_modules.get('users/user')
udm_modules.init(lo, po, module)
dn = 'uid=doesnotexist,cn=users,%s' % c['ldap/base']
o = udm_obj.get(module, None, lo, po, dn)
o.open()
print o.info
-------------------- 8< --------------------

... leads to the following error traceback:
-------------------- 8< --------------------
Traceback (most recent call last):
  File "udm.py", line 13, in <module>
    o.open()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/users/user.py", line 1456, in open
    self['primaryGroup']=None
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 234, in __setitem__
    raise univention.admin.uexceptions.valueRequired, _('The property %s is required') % self.descriptions[key].short_description
univention.admin.uexceptions.valueRequired: The property Primary group is required
-------------------- 8< --------------------
Comment 6 Alexander Kläser univentionstaff 2014-12-12 13:16:39 CET
(In reply to Alexander Kläser from comment #4)
> FYI, I saw the same tracebacks in the USI tarball at Ticket
> #2014110221000053. The information there may help to better understand the
> problem.

Found in var_log_univention_management-console-module-schoolexam.log_1:
-------------------- 8< --------------------
01.12.14 08:06:47.179  DEBUG_INIT
01.12.14 08:08:08.533  MODULE      ( WARN    ) : Could not open user object uid=exam-[...] ... ignoring:
Die Eigenschaft Primäre Gruppe wird benötigt.
01.12.14 08:08:08.538  MODULE      ( WARN    ) : Could not open user object uid=exam-[...] ... ignoring:
Die Eigenschaft Primäre Gruppe wird benötigt.
[...]
01.12.14 08:08:08.610  MODULE      ( PROCESS ) : Vorbereitung der Klassenarbeitskonten - [...]
01.12.14 08:08:09.507  MODULE      ( PROCESS ) : Vorbereitung der Klassenarbeitskonten - [...]
[...]
01.12.14 08:08:19.574  MODULE      ( PROCESS ) : Einrichten der Heimatverzeichnisse - [...]
01.12.14 08:08:19.609  MODULE      ( PROCESS ) : Einrichten der Heimatverzeichnisse - [...]
[...]
01.12.14 08:08:22.851  MODULE      ( PROCESS ) : Verteilung der Klassenarbeitsdateien - 
01.12.14 08:08:36.413  MODULE      ( PROCESS ) : Vorbereiten der Raumeinstellungen - beendet...
-------------------- 8< --------------------
Comment 7 Florian Best univentionstaff 2014-12-19 12:59:44 CET
Reported again, 3.2-4 errata241 (Borgfeld)
Comment 8 Florian Best univentionstaff 2015-01-27 11:43:37 CET
Fixed in svn r57582.

Catching udm_exceptions.base when opening a user object, ignoring it when it fails (write the exception to logfile).
Comment 9 Florian Best univentionstaff 2015-01-27 12:24:05 CET
merged to UCS@school 3.2
Comment 10 Florian Best univentionstaff 2015-02-17 11:37:26 CET
Adapted in svn r58129 to only catch noObject exception and lower log level then.
Comment 11 Sönke Schwardt-Krummrich univentionstaff 2015-02-18 16:27:28 CET
The traceback still occurs since univention.admin.uexceptions.valueRequired is raised and not catched. Attached a possible patch.
Comment 12 Sönke Schwardt-Krummrich univentionstaff 2015-02-18 16:28:20 CET
Created attachment 6695 [details]
Catch noObject exception
Comment 13 Sönke Schwardt-Krummrich univentionstaff 2015-02-18 17:09:46 CET
OK: XML changelog entry
Comment 14 Florian Best univentionstaff 2015-02-19 11:15:44 CET
You're right, fixed, package builds.
Comment 15 Sönke Schwardt-Krummrich univentionstaff 2015-02-19 15:22:28 CET
OK: no traceback when opening groups with alien students
OK: debian changelog entry
OK: XML changelog entry
OK: package is built
OK: code change
OK: no manual change required

ucs-school-umc-groups (3.0.1-4) unstable; urgency=medium
ucs-school-lib (6.0.1-7) unstable; urgency=medium

The following message is created in 
ucs-school-umc-distribution/umc/python/distribution/util.py, is non-critical and not fixed by this bug:

01.12.14 08:08:08.538  MODULE      ( WARN    ) : Could not open user object uid=exam-[...] ... ignoring:
Die Eigenschaft Primäre Gruppe wird benötigt.
Comment 16 Sönke Schwardt-Krummrich univentionstaff 2015-02-27 15:19:41 CET
UCS@school 4.0 v2 has been released:
http://docs.univention.de/release-notes-ucsschool-4.0v2-de.html

If this error occurs again, please use "Clone This Bug".
Comment 17 Florian Best univentionstaff 2015-09-14 17:40:07 CEST
Reported again, 3.2-6 errata363 (Borgfeld)

Remark:
Versuch, als Administrator eine Projektgruppe eines ausgeschiedenen Lehrers einer anderen Kollegin zuzuordnen. Schade ...
Comment 18 Florian Best univentionstaff 2015-09-14 17:42:03 CEST
*** Bug 18784 has been marked as a duplicate of this bug. ***
Comment 19 Florian Best univentionstaff 2015-09-30 10:13:34 CEST
Reported again, 3.2-6 errata372 (Borgfeld)
Comment 20 Florian Best univentionstaff 2015-11-30 13:14:05 CET
Reported again, 3.2-7 errata382 (Borgfeld)

Remark:
Passwörter für Klasse 3a können nicht zurückgesetzt werden
Comment 21 Sönke Schwardt-Krummrich univentionstaff 2015-12-02 10:34:43 CET
(In reply to Florian Best from comment #20)
> Reported again, 3.2-7 errata382 (Borgfeld)
> 
> Remark:
> Passwörter für Klasse 3a können nicht zurückgesetzt werden

Any information which UCS@school version is used? 3.2 R2 v???