Univention Bugzilla – Bug 52680
Second Exam Mode uses outdated uids
Last modified: 2021-04-21 10:45:12 CEST
The customer reported that the issue still occurs. I've checked the log messages and the fix is installed. At least I see this message: 21.01.21 07:59:58.777 MODULE ( PROCESS ) : _thread:1028 Clearing user name cache finished successfully. +++ This bug was initially created as a clone of Bug #52307 +++ A teacher started an exam and realized a minor mistake so she stopped the exam shortly after start. Mistake was fixed. Exam mode was started again shortly after (<5mins). In the now running exam students had no access to their home folders because they had the uid of the exam users of the first attempt. The home folders did not have the uid of the new exam user. Assuming nscd might be the reason here?
Set the status to NEEDMOREINFO because I'm still investigating the support ticket.
The fix from Bug #52307 invalidates the cache while the exam is finished. At that time the user still exists on that system since the replication is not finished. schoolexam.log: 21.01.21 07:59:58.589 MODULE ( PROCESS ) : _thread:1011 Exam user has been removed: u'uid=exam-foo,cn=examusers,ou=xxx,dc=xxx,dc=yyy' [...] 21.01.21 07:59:58.768 MODULE ( PROCESS ) : _thread:1023 Clear user name cache... 21.01.21 07:59:58.777 MODULE ( PROCESS ) : _thread:1028 Clearing user name cache finished successfully. 21.01.21 07:59:58.777 MODULE ( PROCESS ) : _thread:1030 Finished removing exam accounts. listener.log 21.01.21 08:00:17.498 LISTENER ( PROCESS ) : updating 'uid=exam-foo,cn=examusers,ou=xxx,dc=xxx,dc=xxx' command d Maybe the cache should be invalidated just before the creation of the users or the home directory.
Created attachment 10613 [details] Schoolexam nscd cache invalidation after user replication Attached you can find the patch, I've used in the customer environment.
I have difficulties reproducing this problem. The tests run through with and without your provided patch. Could you give some information on the environment where this error occured?
I tried it in a single-server environment at first. Now, in a multi-server environment, I could reproduce the problem manually: 1. Start an exam 2. Check the uids (ldap and local) of a user 3. stop the listener: service univention-directory-listener stop 4. stop the exam 5. Start the listener again and then start a new exam 6. uids from ldap and local (i checked it with udm and id -u) should now differ I applied the patch from comment #4 and the problem did not occur anymore, following the same procedure as described above. The patch was applied with this commit: [troehmey/bug52680_exam_mode_uids] 3f8b189cc Bug #52680: move cache clear However, the ucs-test 101_exam_mode_uids.py which checks this behavior still passes on my system. So the test must be adjusted.
Merged patch to 4.4 with 2c04ec796 Bug #52680: added yaml 39ea96007 Bug #52680: added changelog entry d4e75cf62 Bug #52680: Merge branch 'troehmey/bug52680_exam_mode_uids' into 4.4 Succesful build: Package: ucs-school-umc-exam Version: 9.0.1-50A~4.4.0.202104061550 Branch: ucs_4.4-0 Scope: ucs-school-4.4 The ucs-test still needs to be fixed
I was not able to reproduce the problem with the previous version, and thus I was not able to provide an automatic test. But the change checks out for me: OK: code change OK: package build and yaml OK: update test
Released as erratum for UCS@school 4.4 v9. If you wish to reopen this bug, please clone it instead.