Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

lmLog: "Server error occured" when log contains non-ASCII chars (offset counted in chars, seek in bytes)

オープン
#294 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, python
領域
backend, frontend

調査の方向性

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.coffee sends
    offset=#{$scope.content.length}, which is the length in characters (JS string).
  • lmn_common/views.py → handle_api_log opens 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

linuxmuster/linuxmuster-webui7 のほかの issue

linuxmuster/linuxmuster-webui7 の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。