lmLog: "Server error occured" when log contains non-ASCII chars (offset counted in chars, seek in bytes)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, python
Research direction
Start in lmn_common/views.py at handle_api_log, which seeks by offset, and in lmn_common/resources/js/directives/lmlog.coffee, which sends offset=$scope.content.length. Decide on byte offsets end-to-end (binary read plus a response header the CoffeeScript client uses for the next offset) or the fallback errors='replace'. Reproduce with the two-line Python snippet from the issue, then verify the log view polls past an umlaut-heavy file without a 500.
Written by the indexing model from the issue text.
Description
Description
While users are applied in List Management, the live log view polls
GET /api/lmn/log/tmp/sophomorix.log?offset=<n> every second. Sporadically
the WebUI shows "Server error occured. This is likely a bug." for this request.
The sophomorix run itself completes; only the log view breaks.
Cause
Frontend and backend use different units for offset:
lmn_common/resources/js/directives/lmlog.coffeesends
offset=#{$scope.content.length}, which is the length in characters (JS string).lmn_common/views.py→handle_api_logopens the file in text mode and calls
f.seek(offset), which positions by bytes.
Each non-ASCII character (ä, ö, ü, ß in user names, ...) is 1 char but 2 bytes in
UTF-8, so the offset drifts by one byte per umlaut. When it lands inside a
multibyte sequence, f.read() raises UnicodeDecodeError and the endpoint returns 500.
Minimal reproduction:
open('t.log','w').write('Benutzer Müller angelegt\n')
f = open('t.log'); f.seek(11); f.read()
# UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbc in position 0
With multi-school setups the log easily grows to >1 MB with many umlauts
(we saw offset=1682314), so the error shows up on almost every run.
Environment
linuxmuster-webui7 7.3.40; code is unchanged on master / 7.3.46.
Possible fix
Use byte offsets consistently, e.g. read the file in binary mode and let the
frontend track the received byte length (e.g. via a response header), or at least
open(path, errors='replace') so a misaligned offset no longer causes a 500.
- Dominant language
- HTML
- Stars
- 14
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from linuxmuster/linuxmuster-webui7
-
Lack of sorting the rooms in the roomlist of the device-manager of webuiMay be free again @hermanntoast claimed this 684 days ago, and no pull request is open. Open
linuxmuster/linuxmuster-webui7#278 · 1 comment · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Password print: custom latex templates are not selectableMay be free again @kiarn claimed this 1470 days ago, and no pull request is open. OpenNeeds more details
linuxmuster/linuxmuster-webui7#248 · 4 comments · 1 assignee ·
-
import errors not properly catchedMay be free again @kiarn claimed this 1501 days ago, and no pull request is open. OpenNeeds more details
linuxmuster/linuxmuster-webui7#244 · 4 comments · 1 assignee ·
-
Option: Benutzerdefinierte Felder auf Eindeutigkeit prüfenMay be free again @kiarn claimed this 1501 days ago, and no pull request is open. OpenSophomorix issue
linuxmuster/linuxmuster-webui7#240 · 5 comments · 1 assignee ·
All issues in linuxmuster/linuxmuster-webui7
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
enhancement pkg:sdk
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
aws/aws-durable-execution-sdk-go#144 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
glpi-project/glpi#25883 ·
Maintainers usually reply within 1 day
-
beginner friendly community contributions-welcome enhancement good first issue hacktoberfest help wanted up-for-grabs
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
HTML: <template> content is extracted as document textPossibly taken @ryanmeowy claimed this today. Openbug html
Difficulty 1/5 Under an hour Newbie friendliness 82/100
docling-project/docling#4714 · 2 comments ·
Maintainers usually reply within 1 day