Bug 52307 - 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 v8-errata
Assigned To: Toni Röhmeyer
Ole Schwiegert
:
Depends on:
Blocks: 52680
  Show dependency treegraph
 
Reported: 2020-11-03 12:33 CET by Christian Völker
Modified: 2021-01-23 10:31 CET (History)
5 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

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Völker univentionstaff 2020-11-03 12:33:27 CET
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 3 Sönke Schwardt-Krummrich univentionstaff 2020-11-13 17:15:34 CET
The customer has reported that the following procedure prevented the problem from occurring in his environment (please check again whether this is the same in our environment!)

- Starting the exam
- Stopping the exam
- "nscd -i passwd" on the school slave
- Starting the same exam
Comment 4 Ole Schwiegert univentionstaff 2020-11-24 10:50:08 CET
On oschwieg/4.4/52307 I implemented a test that replicates the error.
Comment 5 Toni Röhmeyer univentionstaff 2020-11-25 11:35:13 CET
More detailed description (taken from our taiga board):
"Creating two exams quickly in succession leads to the second exam mode using the same UIDs as the first. This brings up the problem that users are not able to access their directories anymore due to the directories still belonging to the first exam (which is marked "closed"). The assumption is made that the name service caching daemon is responsible for the behaviour."


Issue fixed with
2c81df86c Bug #52307: invalidate passwd when exam is finished
on branch oschwieg/4.4/52307 .

It implements the execution of "nscd -i passwd" when an exam is finished.
The downside of this is, that all user entries (i.e. even those which did not participate to the exam) get flushed from the name cache. This leads to loading user data being slightly slower for the next time (once per user).

We decided to still implement this option, because the name cache gets refreshed quite frequently anyway. The penalty is barely noticeable and therefore acceptably.

A better solution would have been, to invalidate only those user entries, which participated to the exam. Unfortunately, nscd does not seem to provide that functionality.
Comment 6 Ole Schwiegert univentionstaff 2020-11-26 10:14:49 CET
With the introduced changes the test runs green.
The reason for the code change is documented in code.
The cache invalidation success and failure are documented in the log.

REOPEN for merge&build
Comment 7 Toni Röhmeyer univentionstaff 2020-11-27 10:54:28 CET
Feature branch 'oschwieg/4.4/52307' merged to 4.4 and build:

c4ddabc68 Bug #52307: added yamls
54362f37d Bug #52307: added changelog entries
746cb1f03 Bug #52307: Merge branch 'oschwieg/4.4/52307' into 4.4

Successful builds:

Package: ucs-test-ucsschool
Version: 6.0.163A~4.4.0.202011271039
Branch: ucs_4.4-0
Scope: ucs-school-4.4


Package: ucs-school-umc-exam
Version: 9.0.1-42A~4.4.0.202011271046
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 8 Ole Schwiegert univentionstaff 2020-11-30 10:40:30 CET
The test fails on Jenkins. I suspect a replication/timing problem. I added some wait for replications in the test:

Package: ucs-test-ucsschool
Version: 6.0.165A~4.4.0.202011301038
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 9 Ole Schwiegert univentionstaff 2020-12-14 09:47:46 CET
Tobias found a fix for the failing test and it seems to run fine now.
-> VERIFIED
Comment 10 Daniel Tröder univentionstaff 2021-01-11 11:36:07 CET
UCS@school 4.4 v8 Errata has been released.

https://docs.software-univention.de/changelog-ucsschool-4.4v8-de.html#changelog:ucsschool:2021-01-11

If this error occurs again, please clone this bug.