Univention Bugzilla – Bug 53874
ValueError: Missing school prefix in name
Last modified: 2022-02-07 08:44:29 CET
Version: 4.4-8 errata1036 (Blumenthal) - UCS@school 4.4 v9 Error: Interner Server-Fehler in "schoolgroups/put (teacher)". Request: schoolgroups/put (teacher) Traceback (most recent call last): File "%PY2.7%/univention/management/console/base.py", line 359, in __error_handling six.reraise(etype, exc, etraceback) File "%PY2.7%/univention/management/console/base.py", line 262, in execute function.__func__(self, request, *args, **kwargs) File "%PY2.7%/univention/management/console/modules/decorators.py", line 181, in _response return function(self, request) File "%PY2.7%/ucsschool/lib/school_umc_ldap_connection.py", line 145, in wrapper_func return func(*args, **kwargs) File "%PY2.7%/univention/management/console/modules/schoolgroups/__init__.py", line 222, in put return self.add_teacher_to_classes(request) File "%PY2.7%/univention/management/console/modules/decorators.py", line 181, in _response return function(self, request) File "%PY2.7%/ucsschool/lib/school_umc_ldap_connection.py", line 145, in wrapper_func return func(*args, **kwargs) File "%PY2.7%/univention/management/console/modules/schoolgroups/__init__.py", line 435, in add_teacher_to_classes if not class_.modify(ldap_machine_write): File "%PY2.7%/ucsschool/lib/models/base.py", line 674, in modify success = self.modify_without_hooks(lo, validate, move_if_necessary) File "%PY2.7%/ucsschool/lib/models/group.py", line 267, in modify_without_hooks success = super(SchoolClass, self).modify_without_hooks(lo, validate, move_if_necessary) File "%PY2.7%/ucsschool/lib/models/base.py", line 689, in modify_without_hooks self.validate(lo, validate_unlikely_changes=True) File "%PY2.7%/ucsschool/lib/models/group.py", line 323, in validate raise ValueError("Missing school prefix in name: {!r}.".format(self)) ValueError: Missing school prefix in name: SchoolClass(name='******', school='*****', dn=u'cn=*****,cn=klassen,cn=schueler,cn=groups,ou=******,dc=******,dc=lan'). Role: domaincontroller_master
To make this Traceback more meaningful Missing school prefix in name: SchoolClass(name='sun-AVT6_21', school='SUN', dn='cn=sun-AVT6_21,cn=klassen,cn=schueler,cn=groups,ou=SUN,dc=schein,dc=me'). Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/ucsschool/importer/mass_import/mass_import.py", line 125, in import_users user_import.create_and_modify_users(imported_users) # 90% - 100% File "/usr/lib/python2.7/dist-packages/ucsschool/importer/mass_import/user_import.py", line 225, in create_and_modify_users success = user.modify(lo=self.connection) File "/usr/lib/python2.7/dist-packages/ucsschool/importer/models/import_user.py", line 1088, in modify res = super(ImportUser, self).modify(lo, validate, move_if_necessary) File "/usr/lib/python2.7/dist-packages/ucsschool/lib/models/base.py", line 674, in modify success = self.modify_without_hooks(lo, validate, move_if_necessary) File "/usr/lib/python2.7/dist-packages/ucsschool/importer/models/import_user.py", line 1124, in modify_without_hooks return super(ImportUser, self).modify_without_hooks(lo, validate, move_if_necessary) File "/usr/lib/python2.7/dist-packages/ucsschool/lib/models/base.py", line 701, in modify_without_hooks self.do_modify(udm_obj, lo) File "/usr/lib/python2.7/dist-packages/ucsschool/lib/models/user.py", line 310, in do_modify if not self.remove_from_school(removed_school, lo): File "/usr/lib/python2.7/dist-packages/ucsschool/lib/models/user.py", line 504, in remove_from_school self.remove_from_groups_of_school(school, lo) File "/usr/lib/python2.7/dist-packages/ucsschool/lib/models/user.py", line 519, in remove_from_groups_of_school group.modify(lo) File "/usr/lib/python2.7/dist-packages/ucsschool/lib/models/base.py", line 674, in modify success = self.modify_without_hooks(lo, validate, move_if_necessary) File "/usr/lib/python2.7/dist-packages/ucsschool/lib/models/group.py", line 267, in modify_without_hooks success = super(SchoolClass, self).modify_without_hooks(lo, validate, move_if_necessary) File "/usr/lib/python2.7/dist-packages/ucsschool/lib/models/base.py", line 689, in modify_without_hooks self.validate(lo, validate_unlikely_changes=True) File "/usr/lib/python2.7/dist-packages/ucsschool/lib/models/group.py", line 323, in validate raise ValueError("Missing school prefix in name: {!r}.".format(self)) ValueError: Missing school prefix in name: SchoolClass(name='sun-AVT6_21', school='SUN', dn='cn=sun-AVT6_21,cn=klassen,cn=schueler,cn=groups,ou=SUN,dc=schein,dc=me'). This traceback occurs during import. One school was accidental named with capitals. Now it seems, that this causes trouble, because the class prefix is lower case. The customer gave us the following information: The csv import file contains students from two schools. Students from the first school (moon) just have their school, but the students from the other site have both schools (moon and SUN), because they write their exams on the first school. If a student now moves from a class of the second site to a class of the first site, UCS complains that the student cannot be removed from the group of the second site, because the student has only moon in the import file and not as the group from which he should be removed SUN
The problem is with the inconsistent group name. It must have been manually changed to lower case. The name of all groups in the school "SUN" *must* start with "SUN". When created by UCS@school, that should have been the case. So I assume it was changed manually. The school class' DN 'cn=sun-AVT6_21,cn=klassen,cn=schueler,cn=groups,ou=SUN,dc=schein,dc=me' should be 'cn=SUN-AVT6_21,cn=klassen,cn=schueler,cn=groups,ou=SUN,dc=schein,dc=me'. To fix the groups name, probably two renames will be necessary, as the DN comparisons are case insensitive: ----------------------------- udm groups/group modify --dn cn=sun-AVT6_21,cn=klassen,... --set name=sun-AVT6_21-OLD udm groups/group modify --dn cn=sun-AVT6_21-OLD,cn=klassen,... --set name=SUN-AVT6_21 ----------------------------- If you are sure, that the groups name prefix was created lower case by the system - not manually - please reopen.