Bug 58464 - Classname is not correctly recognized by new LUSD import and caused validation errors
Summary: Classname is not correctly recognized by new LUSD import and caused validatio...
Status: CLOSED FIXED
Alias: None
Product: UCS@school
Classification: Unclassified
Component: General
Version: UCS@school 5.0
Hardware: Other Linux
: P5 normal
Target Milestone: UCS@school 5.2 v3
Assignee: Johannes Königer
QA Contact: Jürn Brodersen
URL: https://git.knut.univention.de/univen...
Keywords:
Depends on:
Blocks: 58499
  Show dependency treegraph
 
Reported: 2025-07-11 11:45 CEST by Christina Scheinig
Modified: 2025-08-04 11:21 CEST (History)
2 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?: 5: Blocking further progress on the daily work
User Pain: 0.086
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2025070421000046
Bug group (optional):
Customer ID:
Max CVSS v3 score:


Attachments
anonymisiertes Logfile (11.17 KB, text/plain)
2025-07-11 11:45 CEST, Christina Scheinig
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christina Scheinig univentionstaff 2025-07-11 11:45:55 CEST
Created attachment 11326 [details]
anonymisiertes Logfile

When switching from the old sisopi import to the new LUSD import, there are problems with the import

Users with the class “Int-K1” are loaded from the LUSD data:
 {
          "schuelerUID": "xxxxxxxxxxxxxxxx",
          "schuelerNachname": "XXX",
          "schuelerVorname": "XXX",
          "dienststellennummer": "XXXXXX",
          "usfbk": "NDHS/S1",
          "stufeSemester": "-/2",
          "klassenname": "Int-K1",
          "schuelerIdEsz": "SXXXXX",
          "dienststellennummerStammschule": "XXXXX"
        },

2025-07-03 17:46:14 INFO  user_import.create_and_modify_users:185  Modifying ImportStudent(name='emwats', school='ucsrms', dn='uid=emwats,cn=schueler,cn=users,ou=uc
srms,dc=portal,dc=schulen-schein,dc=intranet') (source_uid:LUSD_JSON_API record_uid:b73d5f33-723c-4a41-9925-605ef26ae09c) attributes: {'$dn$': 'uid=emwats,cn=schueler,c
n=users,ou=ucsrms,dc=portal,dc=schulen-schein,dc=intranet', 'action': 'M', 'birthday': None, 'disabled': '0', 'display_name': 'Emma Watson', 'email': 'emwats@schulen
-schein.me', 'entry_count': 1172, 'expiration_date': None, 'firstname': 'Emma', 'in_hook': False, 'input_data': {'schuelerUID': 'b73d5f33-723c-4a41-9925-605ef26ae09c', '
schuelerNachname': 'Watson', 'schuelerVorname': 'Emma', 'dienststellennummer': '12345', 'usfbk': 'NDHS/S1', 'stufeSemester': '-/2', 'klassenname': 'Int-K1', 'schueler
IdEsz': 'S3683003', 'dienststellennummerStammschule': '12345'}, 'lastname': 'Watson', 'name': 'emwats', 'objectType': 'users/user', 'old_user': ImportStudent(name='d
ilysule1', school='ucsrms', dn='uid=emwats,cn=schueler,cn=users,ou=ucsrms,dc=portal,dc=schulen-schein,dc=intranet'), 'password': None, 'record_uid': 'b73d5f33-723c-4a41
-9925-605ef26ae09c', 'roles': ['pupil'], 'school': 'ucsrms', 'school_classes': {'ucsrms': ['ucsrms-Int-K1'], 'Int': ['Int-K1']}, 'schools': ['ucsrms'], 'source_uid': 'LUS
D_JSON_API', 'type': 'importStudent', 'type_name': 'Student', 'ucsschool_roles': ['student:school:ucsrms'], 'udm_properties': {'externalDBPrimaryKey': 'b73d5f33-723c-4a41
-9925-605ef26ae09c'}, 'workgroups': {}}...
2025-07-03 17:46:14 DEBUG base.get_only_udm_obj:1120  Getting ImportStudent UDM object by filter: &(!(uid=emwats))(mailPrimaryAddress=emwats@schulen-schein.me)
2025-07-03 17:46:14 ERROR user_import.create_and_modify_users:278  Entry #0: ValidationError when modifying ImportStudent(name='emwats', school='ucsrms', dn='uid=emwats,cn=schueler,cn=users,ou=ucsrms,dc=portal,dc=schulen-schein,dc=intranet') (source_uid:LUSD_JSON_API record_uid: b73d5f33-723c-4a41-9925-605ef26ae09c): {'school_classes
': ["School 'Int' in 'school_classes' is missing in the users 'school(s)' attribute."]} ValidationError({'school_classes': ["School 'Int' in 'school_classes' is missing i
n the users 'school(s)' attribute."]})
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ucsschool/importer/mass_import/user_import.py", line 218, in create_and_modify_users
    raise ValidationError(user.errors.copy())
ucsschool.lib.models.attributes.ValidationError: {'school_classes': ["School 'Int' in 'school_classes' is missing in the users 'school(s)' attribute."]}


Impact is, that the import fails completely
Comment 3 Jürn Brodersen univentionstaff 2025-07-30 09:38:31 CEST
- Code looks good -> OK
- The tests are testing everything I would -> No manual testing
- `root@master:/usr/share/ucs-test/96_ucsschool-import-lusd# pytest-3 *` -> OK
- jenkins -> OK
- changelog -> OK
- No docu changes necessary as far as I can tell -> OK
Comment 4 Jürn Brodersen univentionstaff 2025-07-31 13:01:44 CEST
Errata updates for UCS@school 5.2v3 have been released.

https://docs.software-univention.de/ucsschool-changelog/5.2v3/en/changelog.html
https://docs.software-univention.de/ucsschool-changelog/5.2v3/de/changelog.html

If this error occurs again, please clone this bug.