Bug 56937 - Exam mode throws traceback if local Windows user is logged into a computer
Summary: Exam mode throws traceback if local Windows user is logged into a computer
Status: CLOSED FIXED
Alias: None
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
Version: unspecified
Hardware: Other Linux
: P5 normal
Target Milestone: UCS@school 5.0 v5-errata
Assignee: Johannes Königer
QA Contact: Alexander Steffen
URL:
Keywords:
: 54098 54701 54949 55565 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-12-22 16:04 CET by Julia Bremer
Modified: 2024-11-06 13:47 CET (History)
7 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?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 4: A User would return the product
User Pain: 0.114
Enterprise Customer affected?: Yes
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2023121221000131
Bug group (optional):
Customer ID: 00009, 00021
Max CVSS v3 score:


Attachments
workaround.patch (1.02 KB, patch)
2023-12-22 16:04 CET, Julia Bremer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julia Bremer univentionstaff 2023-12-22 16:04:38 CET
Created attachment 11167 [details]
workaround.patch

If a local Windows user (not a domain user) is logged into any machine within the computerroom, the exam mode throws a traceback and ends without cleaning up. 
An Administrator has to clean up the exam manually before a teacher can retry the exam. 
This caused significant pain in a customer environment, because the exam was still displayed as "running" after the traceback occured and a teacher didn't expect the problem to be severe until after the exam. 

The issue is, that each username on each machine is parsed in the room_management.py code before starting the exam.
It is there assumed, that the name follows the scheme DOMAIN\\username.
The code tries to extract the username from this string, but raises an error if this scheme doesn't mach.
In case a local user is logged into a machine, their name is just "username" without any domain path in front.

We were not sure why this is so strictly checked. If the check can be removed / relaxed, that's great.
But if it is necessary, the state after the error should be cleaned up completely so that a new exam can be started.

This Traceback is generated:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 259, in _run
result = self._function(*args, **kwargs) # type: Union[BaseException, _T]
File "/usr/lib/python3/dist-packages/univention/management/console/modules/schoolexam/__init__.py", line 779, in _thread
customRule=request.options.get("customRule"),
File "/usr/lib/python3/dist-packages/univention/management/console/modules/computerroom/__init__.py", line 208, in _decorated
return func(self, request, *args, **kwargs)
File "/usr/lib/python3/dist-packages/univention/management/console/modules/computerroom/__init__.py", line 945, in _settings_set
self.reset_smb_connections()
File "/usr/lib/python3/dist-packages/univention/management/console/modules/computerroom/__init__.py", line 960, in reset_smb_connections
veyon_users = [x.lower() for x in self._computerroom.users if x]
File "/usr/lib/python3/dist-packages/univention/management/console/modules/computerroom/room_management.py", line 251, in users
for x in self.values()
File "/usr/lib/python3/dist-packages/univention/management/console/modules/computerroom/room_management.py", line 252, in <listcomp>
if x.user.current and x.connected()
File "/usr/lib/python3/dist-packages/univention/management/console/modules/computerroom/room_management.py", line 92, in __getitem__
self._read_user(user)
File "/usr/lib/python3/dist-packages/ucsschool/lib/school_umc_ldap_connection.py", line 156, in wrapper_func
return func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/univention/management/console/modules/computerroom/room_management.py", line 106, in _read_user
username = self.validate_userstr(userstr)
File "/usr/lib/python3/dist-packages/univention/management/console/modules/computerroom/room_management.py", line 98, in validate_userstr
raise AttributeError("invalid key {!r}".format(userstr))
AttributeError: invalid key 'lokalerAccountName'


We hot patched this in the customer environment, so that they can write exams unhindered in the new year.
While this patch is certainly not a correct and clean solution, it enabled the customer to write exams again, even with local users logged into the machines.
Comment 2 Mirac Erdemiroglu univentionstaff 2024-01-18 11:23:13 CET
Command from the partner to this issue:

In my opinion, in this case you should also
in this case, but ask the teacher to fix the problem (local user login) This is probably easier to implement ;)
Comment 3 Johannes Königer univentionstaff 2024-06-28 13:43:14 CEST

```
Successful build
Package: ucs-school-umc-computerroom
Version: 12.0.16
Branch: 5.0-0
Scope: ucs-school-5.0
```

```
Successful build
Package: ucs-test-ucsschool
Version: 7.3.184
Branch: 5.0-0
Scope: ucs-school-5.0
```
Comment 4 Johannes Königer univentionstaff 2024-07-02 17:08:04 CEST
Package update with resolution published on 02.07.2024 for UCS@school 5.0v5.
See https://docs.software-univention.de/ucsschool-changelog/5.0v5/en/index.html
Comment 5 Jan-Luca Kiok univentionstaff 2024-10-10 11:59:52 CEST
*** Bug 54098 has been marked as a duplicate of this bug. ***
Comment 6 Jan-Luca Kiok univentionstaff 2024-10-10 12:00:11 CEST
*** Bug 54701 has been marked as a duplicate of this bug. ***
Comment 7 Jan-Luca Kiok univentionstaff 2024-10-10 12:00:36 CEST
*** Bug 54949 has been marked as a duplicate of this bug. ***
Comment 8 Johannes Königer univentionstaff 2024-11-06 13:47:26 CET
*** Bug 55565 has been marked as a duplicate of this bug. ***