Bug 57319 - Exam mode failes - ValidationError: firstname
Summary: Exam mode failes - ValidationError: firstname
Status: CLOSED FIXED
Alias: None
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
Version: unspecified
Hardware: Other Linux
: P5 normal
Target Milestone: UCS@school 5.0 v5-errata
Assignee: Johannes Königer
QA Contact: Jürn Brodersen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-23 15:04 CEST by Mirac Erdemiroglu
Modified: 2024-10-09 17:16 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.143
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2024041721000145
Bug group (optional):
Customer ID:
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mirac Erdemiroglu univentionstaff 2024-05-23 15:04:15 CEST
UCS: 5.0-6 errata904
Installed: cups=2.2.1 dhcp-server=12.0 prometheus-node-exporter=2.0.1 radius=5.0 samba4=4.16 self-service=5.0 squid=3.5 ucsschool=5.0 v4 4.4/ucsschool-veyon-proxy=4.7.4.14-0
Upgradable:


In a school, the exam mode fails because the student used has not set a first name. The traceback informs you that this is the reason.
In the UMC, the exam mode is canceled without the error message.


17.05.24 15:55:29.577  MODULE      ( PROCESS ) : _thread:622  start_exam() Requesting exam user 10/11 to be created: 'uid=test-ka-02,cn=schueler,cn=users,ou=TS,dc=unterricht,dc=univention,dc=de'
17.05.24 15:55:29.577  MODULE      ( PROCESS ) : info:75  Vorbereitung der Klassenarbeitskonten - (10/11) test-ka-02,  (test-ka-02)
17.05.24 15:55:29.609  MODULE      ( WARN    ) : _thread:646  start_exam() Could not create exam user account for 'uid=test-ka-02,cn=schueler,cn=users,ou=TS,dc=unterricht,dc=univention,dc=de': 591 on UCS-DC01.unter
richt.univention.de (command/schoolexam-master/create-exam-user): {'status': 591, 'message': 'Interner Server-Fehler in "schoolexam-master/create-exam-user".', 'location': 'https://UCS-DC01.unterricht.univention.de/un
ivention/command/schoolexam-master'}
Interner Server-Fehler in "schoolexam-master/create-exam-user".
Request: schoolexam-master/create-exam-user

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 387, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 285, in execute
    function.__func__(self, request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 189, in _response
    return function(self, request)
  File "/usr/lib/python3/dist-packages/ucsschool/lib/school_umc_ldap_connection.py", line 156, in wrapper_func
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/schoolexam-master/__init__.py", line 282, in create_exam_user
    exam_user.modify(ldap_admin_write)
  File "/usr/lib/python3/dist-packages/ucsschool/lib/models/user.py", line 326, in modify
    return super(User, self).modify(lo=lo, validate=validate, move_if_necessary=move_if_necessary)
  File "/usr/lib/python3/dist-packages/ucsschool/lib/models/base.py", line 619, in modify
    success = self.modify_without_hooks(lo, validate, move_if_necessary)
  File "/usr/lib/python3/dist-packages/ucsschool/lib/models/base.py", line 636, in modify_without_hooks
    raise ValidationError(self.errors.copy())
ucsschool.lib.models.attributes.ValidationError: {'firstname': ['"Vorname" ist erforderlich. Bitte ergänzen Sie diese Information.']}
Comment 2 Johannes Königer univentionstaff 2024-07-02 17:10:37 CEST
Package update with resolution published on 02.07.2024 for UCS@school 5.0v5.
See https://docs.software-univention.de/ucsschool-changelog/5.0v5/en/index.html
Comment 3 Mirac Erdemiroglu univentionstaff 2024-10-09 13:00:41 CEST
UCS: 5.0-9 errata1133
Installed: cups=2.2.1 dhcp-server=12.0 prometheus-node-exporter=2.0.1 radius=5.0 samba4=4.16 self-service=5.0 squid=3.5 ucsschool=5.0 v6 ucsschool-veyon-proxy=4.9.0.8-ucs1
Upgradable:


Same customer and same ticket with this issue.

Die folgenden Schüler haben Validierungsfehler:

uid=test.schueler3,cn=schueler,cn=users,ou=TS,dc=unterricht,dc=tsaalen,dc=de
firstname: "Vorname" ist erforderlich. Bitte ergänzen Sie diese Information.
uid=test-ka-03,cn=schueler,cn=users,ou=TS,dc=unterricht,dc=tsaalen,dc=de
firstname: "Vorname" ist erforderlich. Bitte ergänzen Sie diese Information.
uid=test-ka-02,cn=schueler,cn=users,ou=TS,dc=unterricht,dc=tsaalen,dc=de
firstname: "Vorname" ist erforderlich. Bitte ergänzen Sie diese Information.
uid=test-ka-01,cn=schueler,cn=users,ou=TS,dc=unterricht,dc=tsaalen,dc=de
firstname: "Vorname" ist erforderlich. Bitte ergänzen Sie diese Information.

Die Schülerdaten müssen von einem Administrator korrigiert werden bevor die Schüler zu der Klassenarbeit hinzugefügt werden können.
Comment 4 Jan-Luca Kiok univentionstaff 2024-10-09 15:58:18 CEST
(In reply to Mirac Erdemiroglu from comment #3)
> UCS: 5.0-9 errata1133
> Installed: cups=2.2.1 dhcp-server=12.0 prometheus-node-exporter=2.0.1
> radius=5.0 samba4=4.16 self-service=5.0 squid=3.5 ucsschool=5.0 v6
> ucsschool-veyon-proxy=4.9.0.8-ucs1
> Upgradable:
> 
> 
> Same customer and same ticket with this issue.
> 
> Die folgenden Schüler haben Validierungsfehler:
> 
> uid=test.schueler3,cn=schueler,cn=users,ou=TS,dc=unterricht,dc=tsaalen,dc=de
> firstname: "Vorname" ist erforderlich. Bitte ergänzen Sie diese Information.
> uid=test-ka-03,cn=schueler,cn=users,ou=TS,dc=unterricht,dc=tsaalen,dc=de
> firstname: "Vorname" ist erforderlich. Bitte ergänzen Sie diese Information.
> uid=test-ka-02,cn=schueler,cn=users,ou=TS,dc=unterricht,dc=tsaalen,dc=de
> firstname: "Vorname" ist erforderlich. Bitte ergänzen Sie diese Information.
> uid=test-ka-01,cn=schueler,cn=users,ou=TS,dc=unterricht,dc=tsaalen,dc=de
> firstname: "Vorname" ist erforderlich. Bitte ergänzen Sie diese Information.
> 
> Die Schülerdaten müssen von einem Administrator korrigiert werden bevor die
> Schüler zu der Klassenarbeit hinzugefügt werden können.

We had a quick chat about this, for the record: The described behavior is correct. In UCS@school firstname is a required attribute, so users without firstname are invalid - Which is why the validation error is thrown: https://help.univention.com/t/how-a-ucs-school-user-should-look-like/15630#required-attributes-6

What we changed here was that we added an additional validation to the start of the exam - With this the validation does not happen "by accident" as an "internal server error" while creating exam users, but instead this should be handled explicitly before the exam starts to keep a consistent state.

Side note: I am curious to learn how this could happen as neither our importer, the Kelvin API nor the "Users (schools)" UMC module allow (as far as I can tell) to create school users without a firstname in the first place, so there seems to be something wrong in the creation process.
If the users were created via UDM CLI f.e. or the general users module it would be possible to not give a firstname, but these are not supported ways of creating _school_ users - If you still use them (unsupported) you should supply a firstname. :)