Univention Bugzilla – Bug 50588
ExamUser created in wrong OU if users from multiple OUs in exam
Last modified: 2020-03-25 16:09:41 CET
The caching of the DN of the ExamUser container is calculated for only 1 school. If a user for another school should be created, it will be created in the wrong OU.
* The cache for the ExamUser container now holds one entry per OU. * The exam user creation time has been reduced by caching the hosts in a computer room. * Logging has been improved to make future problem analysis easier. [4.4] 501dbda2c Bug #50588: cache exam container per OU [4.4] d49f02538 Bug #50588: cache computers in room [4.4] d5deee544 Bug #50588: improve logging [4.4] 14a5f6a84 Bug #50588: advisory ucs-school-umc-exam (9.0.1-22)
As far as I understand the new exam student is still created in the wrong OU (I started an exam for DEMOSCHOOL): ➜ ~ apt-cache policy ucs-school-umc-exam ucs-school-umc-exam: Installed: 9.0.1-22A~4.4.0.201912040940 Candidate: 9.0.1-22A~4.4.0.201912040940 Version table: *** 9.0.1-22A~4.4.0.201912040940 500 500 http://omar.knut.univention.de/build2 ucs_4.4-0-ucs-school-4.4/all/ Packages 100 /var/lib/dpkg/status 9.0.1-21A~4.4.0.201911131224 500 500 https://appcenter.software-univention.de/univention-repository/4.4/maintained/component ucsschool_20191107161623/all/ Packages ➜ ~ udm users/user list --filter uid=a.e uid=a.e DN: uid=a.e,cn=schueler,cn=users,ou=AE,dc=realm1,dc=intranet birthday: None city: None country: None departmentNumber: AE description: None disabled: 0 displayName: Albert Einstein employeeNumber: None employeeType: None firstname: Albert gecos: Albert Einstein gidNumber: 5098 groups: cn=schueler-demoschool,cn=groups,ou=DEMOSCHOOL,dc=realm1,dc=intranet groups: cn=Domain Users DEMOSCHOOL,cn=groups,ou=DEMOSCHOOL,dc=realm1,dc=intranet groups: cn=schueler-ae,cn=groups,ou=AE,dc=realm1,dc=intranet groups: cn=Domain Users AE,cn=groups,ou=AE,dc=realm1,dc=intranet groups: cn=DEMOSCHOOL-1a,cn=klassen,cn=schueler,cn=groups,ou=DEMOSCHOOL,dc=realm1,dc=intranet groups: cn=AE-1a,cn=klassen,cn=schueler,cn=groups,ou=AE,dc=realm1,dc=intranet homeShare: None homeSharePath: None homedrive: I: initials: None jpegPhoto: None lastname: Einstein locked: 0 lockedTime: 0 mailForwardCopyToSelf: 0 mailHomeServer: None mailPrimaryAddress: None organisation: None overridePWHistory: None overridePWLength: None password: {crypt}$6$HyBmDhtI.Z3SWkAv$J7RFyK5f7wNz8mYcH0myzZQ5PNcgBHZhU9zXbYb/EKgpsgcYyiOeQQ0IGBBd.PGghgLJeCWcspGjGVLBS5GZt/ passwordexpiry: None physicalDeliveryOfficeName: None postcode: None preferredDeliveryMethod: None preferredLanguage: None primaryGroup: cn=Domain Users AE,cn=groups,ou=AE,dc=realm1,dc=intranet profilepath: %LOGONSERVER%\%USERNAME%\windows-profiles\default pwdChangeNextLogin: None sambaLogonHours: None sambaRID: 5592 sambaUserWorkstations: $ sambahome: \\dc0\a.e school: AE school: DEMOSCHOOL scriptpath: ucs-school-logon.vbs shell: /bin/bash street: None title: None ucsschoolPurgeTimestamp: None ucsschoolRecordUID: None ucsschoolRole: student:school:AE ucsschoolSourceUID: None uidNumber: 2296 unixhome: /home/AE/schueler/a.e unlock: None unlockTime: None userexpiry: None username: a.e ➜ ~ udm users/user list --filter uid=exam-a.e uid=exam-a.e DN: uid=exam-a.e,cn=examusers,ou=AE,dc=realm1,dc=intranet birthday: None city: None country: None departmentNumber: AE description: Klassenarbeit für Benutzer a.e disabled: 0 displayName: Albert Einstein employeeNumber: None employeeType: None firstname: Albert gecos: Albert Einstein gidNumber: 5098 groups: cn=schueler-demoschool,cn=groups,ou=DEMOSCHOOL,dc=realm1,dc=intranet groups: cn=Domain Users DEMOSCHOOL,cn=groups,ou=DEMOSCHOOL,dc=realm1,dc=intranet groups: cn=OUdemoschool-Klassenarbeit,cn=ucsschool,cn=groups,dc=realm1,dc=intranet groups: cn=schueler-ae,cn=groups,ou=AE,dc=realm1,dc=intranet groups: cn=Domain Users AE,cn=groups,ou=AE,dc=realm1,dc=intranet groups: cn=DEMOSCHOOL-1a,cn=klassen,cn=schueler,cn=groups,ou=DEMOSCHOOL,dc=realm1,dc=intranet groups: cn=AE-1a,cn=klassen,cn=schueler,cn=groups,ou=AE,dc=realm1,dc=intranet homeShare: None homeSharePath: None homedrive: I: initials: None jpegPhoto: None lastname: Einstein locked: 0 lockedTime: 0 mailForwardCopyToSelf: 0 mailHomeServer: None mailPrimaryAddress: None objectFlag: temporary organisation: None overridePWHistory: None overridePWLength: None password: {crypt}$6$HyBmDhtI.Z3SWkAv$J7RFyK5f7wNz8mYcH0myzZQ5PNcgBHZhU9zXbYb/EKgpsgcYyiOeQQ0IGBBd.PGghgLJeCWcspGjGVLBS5GZt/ passwordexpiry: None physicalDeliveryOfficeName: None postcode: None preferredDeliveryMethod: None preferredLanguage: None primaryGroup: cn=Domain Users AE,cn=groups,ou=AE,dc=realm1,dc=intranet profilepath: %LOGONSERVER%\%USERNAME%\windows-profiles\default pwdChangeNextLogin: None sambaLogonHours: None sambaRID: 5674 sambaUserWorkstations: C1 sambahome: \\dc0\exam-a.e school: DEMOSCHOOL scriptpath: ucs-school-logon.vbs shell: /bin/bash street: None title: None ucsschoolPurgeTimestamp: None ucsschoolRecordUID: None ucsschoolRole: student:school:AE ucsschoolSourceUID: None uidNumber: 2337 unixhome: /home/AE/schueler/exam-homes/exam-a.e.20191125-231400 unlock: None unlockTime: None userexpiry: None username: exam-a.e
Package: ucs-school-umc-exam Version: 9.0.1-23A~4.4.0.202002061034 Branch: ucs_4.4-0 Scope: ucs-school-4.4 Added correct handling for ucsschool roles
commit f2726a7a Bug #50588: Extended README.md with information on what identifies an ExamUser I started documenting in the README what identifies an ExamUser at the moment.
[4.4 4986fb9e7] Bug #50588: cleanup indentation OK What I tested: exam user now has the role "exam_user:school:DEMOSCHOOL" -> OK
As discussed I tested a user in multiple school writing multiple exams. I tested this with multiple schools on a single server! -> REOPEN: - If an exam is finished, the role isn't removed - If all exams are finished the exam user is not removed at all? I get the following error from the master module, which might be helpful 07.02.20 16:13:02.302 MODULE ( WARN ) : Could not remove exam user account uid=exam-demo_student,cn=examusers,ou=DEMOSCHOOL,dc=univention,dc=intranet: 591 on sm44-2.univention.intranet (command/schoolexam-master/remove-exam-user): {"status": 591, "message": "Interner Server-Fehler in \"schoolexam-master/remove-exam-user\".", "traceback": "Interner Server-Fehler in \"schoolexam-master/remove-exam-user\".\nRequest: schoolexam-master/remove-exam-user\n\nTraceback (most recent call last):\n File \"/usr/lib/python2.7/dist-packages/univention/management/console/base.py\", line 358, in __error_handling\n six.reraise(etype, exc, etraceback)\n File \"/usr/lib/python2.7/dist-packages/univention/management/console/base.py\", line 261, in execute\n function.__func__(self, request, *args, **kwargs)\n File \"/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py\", line 181, in _response\n return function(self, request)\n File \"/usr/lib/pymodules/python2.7/ucsschool/lib/school_umc_ldap_connection.py\", line 123, in wrapper_func\n return func(*args, **kwargs)\n File \"/usr/lib/pymodules/python2.7/univention/management/console/modules/schoolexam-master/__init__.py\", line 476, in remove_exam_user\n user.modify(ldap_admin_write)\n File \"/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py\", line 542, in modify\n success = self.modify_without_hooks(lo, validate, move_if_necessary)\n File \"/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py\", line 559, in modify_without_hooks\n raise ValidationError(self.errors.copy())\nValidationError: {'school_classes': [u\"Schule 'hb2' in 'school_classes' fehlt im 'school(s)' Attributen des Benutzers.\"]}", "location": "https://sm44-2.univention.intranet/univention/command"}
Reverted changes: Package: ucs-school-umc-exam Version: 9.0.1-26A~4.4.0.202002101158 Branch: ucs_4.4-0 Scope: ucs-school-4.4 Other problems emerged after fixing this issue. Since we need to release the modified package soon we have no other choice than to revert the changes made for this Bug.
Correct version for revert is: Package: ucs-school-umc-exam Version: 9.0.1-27A~4.4.0.202002101204 Branch: ucs_4.4-0 Scope: ucs-school-4.4
Can we please release the changes made by those two commits in separate bugs? [4.4] d49f02538 Bug #50588: cache computers in room [4.4] d5deee544 Bug #50588: improve logging Those are sorely needed changes: * The first one improves the exam creation time. * The second one improves the problem analysis. Both changes are unrelated to the problem this bug tries to handle.
I split the two specified issues into Bugs #50817 and #50818 Now this bug only handles the faulty creation of the ExamUser regarding OUs and multi school students.
[4.4] b03257cb0 Bug #50588: update advisory
The remaining commit was applied in oschwieg/4.4/50819. Please do the QA together with the QA for Bug #50819. REOPEN for merge&build
Package: ucs-school-umc-exam Version: 9.0.1-31A~4.4.0.202002211439 Branch: ucs_4.4-0 Scope: ucs-school-4.4
OK exam students are now created in the main school of the student Other changes see Bug #50819 as mentioned above -> Verified
UCS@school 4.4 v5 has been released. https://docs.software-univention.de/changelog-ucsschool-4.4v5-de.html If this error occurs again, please clone this bug.