Problem: Opening the exam module and try to list all running exams shows an traceback

Problem:

Opening the exam module and try to list all running exams shows an traceback

3.02.20 12:23:36.650  MAIN        ( ERROR   ) : Interner Server-Fehler in "schoolexam/query".
Request: schoolexam/query

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 358, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 261, in execute
    function.__func__(self, request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 181, in _response
    return function(self, request)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/school_umc_ldap_connection.py", line 123, in wrapper_func
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/schoolexam/__init__.py", line 754, in query
    if pattern.match(project.name) and (filter == 'all' or compare_dn(project.sender.dn, self.user_dn))
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/school_umc_ldap_connection.py", line 123, in wrapper_func
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/schoolexam/__init__.py", line 198, in _user_can_modify
    sender_user = User.from_dn(exam.sender.dn, None, ldap_user_read)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 950, in from_dn
    udm_obj = udm_modules.lookup(cls._meta.udm_module, None, lo, filter=cls._meta.udm_filter, base=dn, scope='base', superordinate=superordinate)[0]
  File "/usr/lib/python2.7/dist-packages/univention/admin/modules.py", line 916, in lookup
    tmpres = module.lookup(co, lo, filter, base=base, superordinate=superordinate, scope=scope, unique=unique, required=required, timeout=timeout, sizelimit=sizelimit)
  File "/usr/lib/python2.7/dist-packages/univention/admin/handlers/__init__.py", line 1739, in lookup
    for dn, attrs in lo.search(filter_str, base, scope, attr, unique, required, timeout, sizelimit, serverctrls=serverctrls, response=response):
  File "/usr/lib/python2.7/dist-packages/univention/admin/uldap.py", line 757, in search
    raise univention.admin.uexceptions.noObject(_err2str(msg))

Solution:

This can occur, if there are some exam remainings left, maybe from a teacher, who is no longer at the school.

You can have a look for remainings in:
ls -lah /var/lib/ucs-school-umc-schoolexam/
If there are old files, these are empty and no exam is running, you can delete these files. This should fix the exam listing in the exam module

Mastodon