Bug 56937 - Exam mode throws traceback if local Windows user is logged into a computer
Exam mode throws traceback if local Windows user is logged into a computer
Status: NEW
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
unspecified
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-12-22 16:04 CET by Julia Bremer
Modified: 2024-02-05 15:59 CET (History)
3 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):
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 ;)