Bug 57367 - Exam mode failes - RuntimeError: Unable to load default file
Exam mode failes - RuntimeError: Unable to load default file
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
UCS@school 5.0
Other Linux
: P5 normal (vote)
: UCS@school 5.0 v5-errata
Assigned To: Tobias Wenzel
Johannes Königer
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2024-05-29 11:14 CEST by Mirac Erdemiroglu
Modified: 2024-07-02 17:10 CEST (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?: 5: Blocking further progress on the daily work
User Pain: 0.143
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2024041721000145
Bug group (optional): Usability
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mirac Erdemiroglu univentionstaff 2024-05-29 11:14:01 CEST
UCS: 5.0-6 errata904
Installed: cups=2.2.1 dhcp-server=12.0 prometheus-node-exporter=2.0.1 radius=5.0 samba4=4.16 self-service=5.0 squid=3.5 ucsschool=5.0 v4 4.4/ucsschool-veyon-proxy=4.7.4.14-0
Upgradable:

The exam mode is terminated unexpectedly and the error message is Unable to load default file.
It would certainly help to explain which file is the default file, where it is located and why it could not be loaded.
In addition, in my opinion, the exam mode should not simply be canceled, but wait for it or try again to start the class work successfully so that it can be run.

15.05.24 07:42:19.530  MODULE      ( PROCESS ) : Received request 'schoolexam/progress': ('m.erde', None, None, 'de_DE.UTF-8')
15.05.24 07:42:19.590  MODULE      ( PROCESS ) : _finished:789  result=RuntimeError('Unable to load default file')
15.05.24 07:42:19.590  MODULE      ( PROCESS ) : info:75  Vorbereiten der Raumeinstellungen - beendet...
15.05.24 07:42:19.614  MODULE      ( INFO    ) : creating project cache dir: /var/lib/ucs-school-umc-schoolexam/XXX_AP.data
15.05.24 07:42:19.614  MODULE      ( INFO    ) : cache dir /var/lib/ucs-school-umc-schoolexam/XXX_AP.data exists.
15.05.24 07:42:19.615  MODULE      ( WARN    ) : error:79  Vorbereiten der Raumeinstellungen - RuntimeError: Unable to load default file


15.05.24 07:45:37.461  MODULE      ( INFO    ) : Ping not successfull for e-r300-14 with IP xx.xx.xx.xx
15.05.24 07:45:37.461  MODULE      ( INFO    ) : e-r300-14: Updating information was not successful.
15.05.24 07:45:37.461  MODULE      ( INFO    ) : Ping not successfull for e-r300-08 with IP xx.xx.xx.xxx
15.05.24 07:45:37.461  MODULE      ( INFO    ) : e-r300-08: Updating information was not successful.
15.05.24 07:45:37.494  MODULE      ( INFO    ) : R300-7R: updating information.
15.05.24 07:45:37.495  MODULE      ( INFO    ) : R300-8R: updating information.
15.05.24 07:45:37.502  MODULE      ( INFO    ) : Ping not successfull for R300-1r with IP xx.xx.xx.x
15.05.24 07:45:37.502  MODULE      ( INFO    ) : R300-1r: Updating information was not successful.
15.05.24 07:45:37.503  MODULE      ( PROCESS ) : _finished:789  result=RuntimeError('Unable to load default file')
15.05.24 07:45:37.503  MODULE      ( PROCESS ) : info:75  Vorbereiten der Raumeinstellungen - beendet...
15.05.24 07:45:37.505  MODULE      ( INFO    ) : Ping not successfull for R300-4R with IP xx.xx.xx.x
15.05.24 07:45:37.505  MODULE      ( INFO    ) : R300-4R: Updating information was not successful.
15.05.24 07:45:37.506  MODULE      ( INFO    ) : Ping not successfull for R300-6l with IP xx.xx.xx.xx
15.05.24 07:45:37.506  MODULE      ( INFO    ) : R300-6l: Updating information was not successful.
15.05.24 07:45:37.507  MODULE      ( INFO    ) : R300-8r: updating information.
15.05.24 07:45:37.510  MODULE      ( INFO    ) : Ping not successfull for R300-1R with IP xx.x.x.x
15.05.24 07:45:37.510  MODULE      ( INFO    ) : R300-1R: Updating information was not successful.
15.05.24 07:45:37.512  MODULE      ( INFO    ) : R300-3L: updating information.
15.05.24 07:45:37.530  MODULE      ( INFO    ) : Ping not successfull for R300-2L with IP xx.xx.xx.x
15.05.24 07:45:37.530  MODULE      ( INFO    ) : R300-2L: Updating information was not successful.
15.05.24 07:45:37.581  MODULE      ( INFO    ) : creating project cache dir: /var/lib/ucs-school-umc-schoolexam/XXX-Theorieprüfung.data
15.05.24 07:45:37.623  MODULE      ( INFO    ) : R300-3r: updating information.
15.05.24 07:45:37.632  MODULE      ( WARN    ) : error:79  Vorbereiten der Raumeinstellungen - RuntimeError: Unable to load default file



Quote from S.Gohmann:
I have just looked at the code of the S4 Listener module. If I understand it correctly, the old file is actually removed before it is rewritten. This means that there is a period of time in which a load would go wrong:
https://git.knut.univention.de/univention/ucs/-/blob/5.0-7/services/univention-samba4/samba-shares.py?ref_type=heads#L137

The error must be intercepted and dealt with in the corresponding code.
Comment 2 Jürn Brodersen univentionstaff 2024-05-31 12:00:22 CEST
We had this problem in the past if the samba configuration had an issue:

Bug 53464
Comment 4 Stefan Gohmann univentionstaff 2024-05-31 16:00:36 CEST
But in this case, it ran through several times without any problems and then suddenly stopped working. I think it is started per exam user.

My suspicion is that there are side effects when the samba share configuration is rewritten.
Comment 5 Jürn Brodersen univentionstaff 2024-06-03 14:12:38 CEST
I opened a bug for the samba shares bug 57374
Comment 6 Jürn Brodersen univentionstaff 2024-06-03 14:33:18 CEST
The share restrictions have a similar problem: bug 57376
Comment 7 Jürn Brodersen univentionstaff 2024-06-03 14:40:19 CEST
Both bug 57374 and bug 57376 should only be a problem in a very short time frame and, as far as I can tell, can only be triggered if somebody works in parallel. Either by changing a share or starting/stopping an exam.

I would have expected the odds of this happening to be rather low, so I'm not sure if either of these are the underlying problem. Though I think it still makes sense to fix these bugs just to make sure they are not the problem.
Comment 8 Jürn Brodersen univentionstaff 2024-06-03 14:42:16 CEST
Note: missing files can be printed with samba-tool (the debug-level is important)

```
root@replica1:/etc/samba# samba-tool testparm --debuglevel=2
lpcfg_load: refreshing parameters from /etc/samba/smb.conf
Can't find include file /etc/samba/local.config.conf
ERROR: Unable to load default file
```
Comment 9 Stefan Gohmann univentionstaff 2024-06-05 09:56:33 CEST
(In reply to Jürn Brodersen from comment #7)
> Both bug 57374 and bug 57376 should only be a problem in a very short time
> frame and, as far as I can tell, can only be triggered if somebody works in
> parallel. Either by changing a share or starting/stopping an exam.
> 
> I would have expected the odds of this happening to be rather low, so I'm
> not sure if either of these are the underlying problem. Though I think it
> still makes sense to fix these bugs just to make sure they are not the
> problem.

It could be a side effect / timing issue because a lot is done at the start of an exam. I think it would be very good if you could catch and log the error in such a case and then try again after a few seconds. If it still doesn't work, you can always abort.
Comment 10 Stefan Gohmann univentionstaff 2024-06-05 09:58:02 CEST
BTW: The customer was able to reproduce it once again.
Comment 14 Jürn Brodersen univentionstaff 2024-06-19 15:39:24 CEST
Note:

Our fix is not fixing the underlying issue of a broken samba conf.

The fix does the following:
- Adds a better error message
- Adds a retry around loading the samba configuration
- The samba configuration is now only loaded once at the startup of the module, which should make it less likely for a customer to run into the problem.
Comment 15 Johannes Königer univentionstaff 2024-07-02 17:10:36 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