lmLog: "Server error occured" when log contains non-ASCII chars (offset counted in chars, seek in bytes)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, python
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- HTML
- Stelle
- 14
- Fork
- 9
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di linuxmuster/linuxmuster-webui7
-
Lack of sorting the rooms in the roomlist of the device-manager of webuiForse di nuovo libera @hermanntoast l’ha presa 687 giorni fa e non c’è nessuna pull request aperta. Aperta
linuxmuster/linuxmuster-webui7#278 · 1 commento · 1 assegnatario ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Password print: custom latex templates are not selectableForse di nuovo libera @kiarn l’ha presa 1473 giorni fa e non c’è nessuna pull request aperta. ApertaNeeds more details
linuxmuster/linuxmuster-webui7#248 · 4 commenti · 1 assegnatario ·
-
import errors not properly catchedForse di nuovo libera @kiarn l’ha presa 1504 giorni fa e non c’è nessuna pull request aperta. ApertaNeeds more details
linuxmuster/linuxmuster-webui7#244 · 4 commenti · 1 assegnatario ·
-
Option: Benutzerdefinierte Felder auf Eindeutigkeit prüfenForse di nuovo libera @kiarn l’ha presa 1504 giorni fa e non c’è nessuna pull request aperta. ApertaSophomorix issue
linuxmuster/linuxmuster-webui7#240 · 5 commenti · 1 assegnatario ·
Tutte le issue di linuxmuster/linuxmuster-webui7
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
supabase-community/supabase-kt#1413 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 83/100
PedestrianDynamics/pyFDS-Evac#766 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
prime-radiant-inc/evener#4329 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 2 giorni
-
CartLineConstraint Jacobian always writes 6 rows, overruns when indices has fewer than 6 entriesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
tesseract-robotics/trajopt#618 ·
I maintainer di solito rispondono entro 1 giorno