Univention Bugzilla – Bug 52307
Second Exam Mode uses outdated uids
Last modified: 2021-01-23 10:31:28 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?
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
On oschwieg/4.4/52307 I implemented a test that replicates the error.
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.
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
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
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
Tobias found a fix for the failing test and it seems to run fine now. -> VERIFIED
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.