Bug 50588 - ExamUser created in wrong OU if users from multiple OUs in exam
ExamUser created in wrong OU if users from multiple OUs in exam
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
UCS@school 4.4
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v4-errata
Assigned To: Ole Schwiegert
Jürn Brodersen
:
Depends on: 50819
Blocks:
  Show dependency treegraph
 
Reported: 2019-12-04 09:16 CET by Daniel Tröder
Modified: 2020-03-25 16:09 CET (History)
3 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?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2019120221000346
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2019-12-04 09:16: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.
Comment 1 Daniel Tröder univentionstaff 2019-12-04 09:44:13 CET
* 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)
Comment 2 Ole Schwiegert univentionstaff 2020-02-05 09:31:23 CET
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
Comment 3 Ole Schwiegert univentionstaff 2020-02-06 10:34:42 CET
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
Comment 4 Ole Schwiegert univentionstaff 2020-02-06 10:42:25 CET
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.
Comment 5 Jürn Brodersen univentionstaff 2020-02-06 23:29:13 CET
[4.4 4986fb9e7] Bug #50588: cleanup indentation

OK
What I tested:
exam user now has the role "exam_user:school:DEMOSCHOOL" -> OK
Comment 6 Jürn Brodersen univentionstaff 2020-02-07 16:26:22 CET
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"}
Comment 7 Ole Schwiegert univentionstaff 2020-02-10 11:59:27 CET
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.
Comment 8 Ole Schwiegert univentionstaff 2020-02-10 12:06:10 CET
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
Comment 9 Daniel Tröder univentionstaff 2020-02-11 09:50:54 CET
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.
Comment 10 Ole Schwiegert univentionstaff 2020-02-13 08:25:15 CET
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.
Comment 11 Sönke Schwardt-Krummrich univentionstaff 2020-02-13 18:09:31 CET
[4.4] b03257cb0 Bug #50588: update advisory
Comment 12 Ole Schwiegert univentionstaff 2020-02-17 10:31:18 CET
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
Comment 13 Ole Schwiegert univentionstaff 2020-02-21 14:47:24 CET
Package: ucs-school-umc-exam
Version: 9.0.1-31A~4.4.0.202002211439
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 14 Jürn Brodersen univentionstaff 2020-02-25 22:17:21 CET
OK exam students are now created in the main school of the student
Other changes see Bug #50819 as mentioned above

-> Verified
Comment 15 Sönke Schwardt-Krummrich univentionstaff 2020-03-25 16:09:41 CET
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.