Bug 52680 - Second Exam Mode uses outdated uids
Second Exam Mode uses outdated uids
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
unspecified
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v9-errata
Assigned To: Toni Röhmeyer
Daniel Tröder
:
Depends on: 52307
Blocks:
  Show dependency treegraph
 
Reported: 2021-01-23 10:31 CET by Stefan Gohmann
Modified: 2021-04-21 10:45 CEST (History)
8 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.257
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support: Yes
Flags outvoted (downgraded) after PO Review:
Ticket number: 2020110221000541
Bug group (optional):
Max CVSS v3 score:


Attachments
Schoolexam nscd cache invalidation after user replication (2.08 KB, patch)
2021-02-05 20:25 CET, Stefan Gohmann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2021-01-23 10:31:28 CET
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?
Comment 1 Stefan Gohmann univentionstaff 2021-01-23 10:34:35 CET
Set the status to NEEDMOREINFO because I'm still investigating the support ticket.
Comment 2 Stefan Gohmann univentionstaff 2021-01-27 16:21:54 CET
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.
Comment 4 Stefan Gohmann univentionstaff 2021-02-05 20:25:05 CET
Created attachment 10613 [details]
Schoolexam nscd cache invalidation after user replication

Attached you can find the patch, I've used in the customer environment.
Comment 5 Toni Röhmeyer univentionstaff 2021-03-31 15:29:37 CEST
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?
Comment 6 Toni Röhmeyer univentionstaff 2021-04-05 20:09:27 CEST
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.
Comment 7 Toni Röhmeyer univentionstaff 2021-04-06 15:59:05 CEST
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
Comment 8 Daniel Tröder univentionstaff 2021-04-20 17:03:34 CEST
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
Comment 9 Daniel Tröder univentionstaff 2021-04-21 10:45:12 CEST
Released as erratum for UCS@school 4.4 v9.

If you wish to reopen this bug, please clone it instead.