lmLog: "Server error occured" when log contains non-ASCII chars (offset counted in chars, seek in bytes)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, python
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- HTML
- Estrellas
- 14
- Forks
- 9
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de linuxmuster/linuxmuster-webui7
-
Lack of sorting the rooms in the roomlist of the device-manager of webuiQuizá libre de nuevo @hermanntoast la tomó hace 685 días y no hay ningún pull request abierto. Abierto
linuxmuster/linuxmuster-webui7#278 · 1 comentario · 1 asignado ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
-
Password print: custom latex templates are not selectableQuizá libre de nuevo @kiarn la tomó hace 1471 días y no hay ningún pull request abierto. AbiertoNeeds more details
linuxmuster/linuxmuster-webui7#248 · 4 comentarios · 1 asignado ·
-
import errors not properly catchedQuizá libre de nuevo @kiarn la tomó hace 1502 días y no hay ningún pull request abierto. AbiertoNeeds more details
linuxmuster/linuxmuster-webui7#244 · 4 comentarios · 1 asignado ·
-
Option: Benutzerdefinierte Felder auf Eindeutigkeit prüfenQuizá libre de nuevo @kiarn la tomó hace 1501 días y no hay ningún pull request abierto. AbiertoSophomorix issue
linuxmuster/linuxmuster-webui7#240 · 5 comentarios · 1 asignado ·
Todos los issues de linuxmuster/linuxmuster-webui7
Issues similares
-
Fix Math.ceilDiv wrong result for exact positive divisionsPosiblemente ocupada @pamod-madubashana la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
scala-native/scala-native#5094 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Code Quality
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Automattic/safe-publish#708 ·
Los mantenedores suelen responder en 1 día
-
gcsartifact: deleting a missing version returns an errorPosiblemente ocupada @ktsoator la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días