Univention Bugzilla – Bug 56419
ucs-school-testuser-import creates email addresses the importer rejects
Last modified: 2023-08-14 14:41:49 CEST
A couple of names in the test data file /usr/share/doc/ucs-school-import/test_data.json.gz end with a full stop (e.g. given name "Nanetta." or family name "Pove..."). If one such a name is chosen, the email address the importer auto-generates contains more than one consecutive full stop (e.g. "nanetta..farck@<fqdn>" or "ioanna.peru...@<fqdn>"). Such addresses are rejected by the importer with the following error message: 2023-08-09 15:20:01 ERROR user_import.create_and_modify_users:278 Entry #0: ValidationError when adding ImportStudent(name='nanetta..farck', school='Perf31', dn='uid=nanetta..farck,cn=schueler,cn=users,ou=Perf31,dc=ucs,dc=test,dc=myschool,dc=bildungslogin,dc=de', old_dn=None) (source_uid:Perf31 record_uid: Nanetta..Farck): {'email': ['Not a valid email address! The email address contains invalid characters before the @-sign: FULL STOP.']} ValidationError({'email': ['Not a valid email address! The email address contains invalid characters before the @-sign: FULL STOP.']}) The same error message happens if the family name's the one ending with a full stop, too. I would argue that there are two issues here: 1. The test data shouldn't contain names that end with a full stop as those names don't usually exist. 2. The importer rejecting email addresses that aren't really invalid, especially with an error message that's just plain wrong: there's no full stop directly before the @ Either way, the importer aborts. How to reproduce: 1. Reduce the test_data.json.gz to one given & one family name, with the given name endingn in a full stop. For example: { "given": [ "Nanetta." ], "family": [ "Farck" ] } 2. Adjust the import config to use a schema that auto-generates an email address from the login name, e.g. "email": "<username>@<maildomain>", 3. Create demo users: /usr/share/ucs-school-import/scripts/ucs-school-testuser-import --staff 0 --students 1 --teachers 0 --staffteachers 0 --classes 1 --inclasses 1 --schools 0 <School ID> Version info: [0 root@dc-primary.ucs.test.myschool.bildungslogin.de ~] ucr search --brief '^version/' version/erratalevel: 772 version/patchlevel: 3 version/releasename: Blumenthal version/version: 5.0 [0 root@dc-primary.ucs.test.myschool.bildungslogin.de ~] univention-app info UCS: 5.0-3 errata772 Installed: self-service=5.0 self-service-backend=5.0 ucsschool=5.0 v3 4.4/openid-connect-provider=2.2-konnect-0.33.11-2 4.4/ucsschool-apis=1.0.6 4.4/ucsschool-kelvin-rest-api=1.8.9 4.4/ucsschool-veyon-proxy=4.7.4.14-0 Upgradable: ucsschool
Thanks for the report, I agree with both points mentioned. My remarks: > 2. The importer rejecting email addresses that aren't really invalid, especially with an error message that's just plain wrong: there's no full stop directly before the @ That sounds similar to https://forge.univention.org/bugzilla/show_bug.cgi?id=53933, it might make sense to look into both together or at least come to a uniform solution. > 1. The test data shouldn't contain names that end with a full stop as those names don't usually exist. I guess this is something we can tackle beforehand too, the balance will be to come to a test set that includes edge cases that indeed concern the import on one hand and not including things like this on the other hand. Have you found other subpar test data sets or was the full stop the only thing you encountered?
Thanks for the feedback. > Have you found other subpar test data sets or was the full stop the only thing you encountered? We've used the generator to import 100 schools with 1.000 students each. This particular issue was the only one that caused the import to fail. I opted to remove the . from the names in the test data set in order to have the import run unattended (which takes quite a while for these many entries), and afterwards everything ran fine. In other words: this was the only issue I encountered.