lmLog: "Server error occured" when log contains non-ASCII chars (offset counted in chars, seek in bytes)
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, python
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- HTML
- スター
- 14
- フォーク
- 9
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
linuxmuster/linuxmuster-webui7 のほかの issue
-
Lack of sorting the rooms in the roomlist of the device-manager of webui再び着手できるかも @hermanntoast が 685 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
linuxmuster/linuxmuster-webui7#278 · コメント 1 件 · 担当者 1 名 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
Password print: custom latex templates are not selectable再び着手できるかも @kiarn が 1471 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンNeeds more details
linuxmuster/linuxmuster-webui7#248 · コメント 4 件 · 担当者 1 名 ·
-
import errors not properly catched再び着手できるかも @kiarn が 1502 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンNeeds more details
linuxmuster/linuxmuster-webui7#244 · コメント 4 件 · 担当者 1 名 ·
-
Option: Benutzerdefinierte Felder auf Eindeutigkeit prüfen再び着手できるかも @kiarn が 1501 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンSophomorix issue
linuxmuster/linuxmuster-webui7#240 · コメント 5 件 · 担当者 1 名 ·
linuxmuster/linuxmuster-webui7 の issue をすべて見る
似ている issue
-
Fix Math.ceilDiv wrong result for exact positive divisions対応中かも @pamod-madubashana が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
scala-native/scala-native#5094 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
Code Quality
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Automattic/safe-publish#708 ·
メンテナーはふだん 1 日以内に返信
-
gcsartifact: deleting a missing version returns an error対応中かも @ktsoator が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信