Bug 51717 - schoolusers/schools does not work anymore
schoolusers/schools does not work anymore
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Ucsschool-lib
UCS@school 4.4
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v5-errata
Assigned To: Ole Schwiegert
Tobias Wenzel
:
Depends on:
Blocks: 50625
  Show dependency treegraph
 
Reported: 2020-07-23 08:53 CEST by Ole Schwiegert
Modified: 2020-07-30 13:15 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
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):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ole Schwiegert univentionstaff 2020-07-23 08:53:57 CEST
In our current unpublished packages we have an error that causes the following error message:

Interner Server-Fehler in "schoolusers/schools (student)".
Request: schoolusers/schools (student)

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 359, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 262, in execute
    function.__func__(self, request, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/school_umc_ldap_connection.py", line 141, in wrapper_func
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/school_umc_base.py", line 123, in schools
    schools = School.from_binddn(ldap_user_read)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/school.py", line 647, in from_binddn
    return School.get_all(lo)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/school.py", line 659, in get_all
    lo, school=None, filter_str=filter_str, easy_filter=easy_filter
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 869, in get_all
    ret.append(cls.from_udm_obj(udm_obj, school, lo))
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/school.py", line 651, in from_udm_obj
    obj = super(School, cls).from_udm_obj(udm_obj, school, lo)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 958, in from_udm_obj
    obj = cls(**deepcopy(attrs))
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/school.py", line 85, in __init__
    super(School, self).__init__(name=name, **kwargs)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 302, in __init__
    self.old_dn = self.dn
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 331, in dn
    name = self._meta.ldap_map_function(self.name)
AttributeError: 'UCSSchoolHelperOptions' object has no attribute 'ldap_map_function'


We do not know yet where this problem originates from, but it has to be fixed if we want to publish any erratas.
Comment 1 Ole Schwiegert univentionstaff 2020-07-23 10:19:23 CEST
The problem we found was that udm_modules.get() always returned None. This is usually due to the fact that udm_modules.update() was not invoked before.

My guess is that with the code reformatting and the changes of import orders an implicit udm_modules.update was previously invoked before the use of meta.py.

A udm_modules.update() call was added to meta.py which fixed the problem. Please QA in oschwieg/51717
 and REOPEN for merge&build
Comment 2 Tobias Wenzel univentionstaff 2020-07-23 10:29:06 CEST
QA -> All OK -> REOPEN for merge&build
Code -> OK
Functionality -> OK

Before fix:

from ucsschool.lib.models import School
from univention.admin.uldap import getAdminConnection

lo,po=getAdminConnection()
School.get_all(lo, None)
AttributeError: 'UCSSchoolHelperOptions' object has no attribute 'ldap_map_function'

The error is also raised in the school users UMC module. 

After fix

-> no error, UMC Modules do not raise Errors.
Comment 3 Ole Schwiegert univentionstaff 2020-07-23 10:39:12 CEST
Package: ucs-school-lib
Version: 12.1.16A~4.4.0.202007231036
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 4 Tobias Wenzel univentionstaff 2020-07-23 10:53:00 CEST
All OK -> VERIFIED 
Functionality -> OK (same as in comment 2)
Changelog -> OK
YAML -> OK
Comment 5 Florian Best univentionstaff 2020-07-26 20:11:57 CEST
There is no target milestone set.
Comment 6 Tobias Wenzel univentionstaff 2020-07-30 13:15:11 CEST
UCS@school 4.4 v5 has been released (errata update to the release).

http://docs.software-univention.de/changelog-ucsschool-4.4v5-de.html#changelog:ucsschool:2020-07-30

If this error occurs again, please clone this bug.