lmLog: "Server error occured" when log contains non-ASCII chars (offset counted in chars, seek in bytes)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, python
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- HTML
- Star
- 14
- Fork
- 9
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của linuxmuster/linuxmuster-webui7
-
Lack of sorting the rooms in the roomlist of the device-manager of webuiCó thể làm lại được @hermanntoast đã nhận 685 ngày trước và không có pull request nào đang mở. Đang mở
linuxmuster/linuxmuster-webui7#278 · 1 bình luận · 1 người được giao ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Password print: custom latex templates are not selectableCó thể làm lại được @kiarn đã nhận 1471 ngày trước và không có pull request nào đang mở. Đang mởNeeds more details
linuxmuster/linuxmuster-webui7#248 · 4 bình luận · 1 người được giao ·
-
import errors not properly catchedCó thể làm lại được @kiarn đã nhận 1502 ngày trước và không có pull request nào đang mở. Đang mởNeeds more details
linuxmuster/linuxmuster-webui7#244 · 4 bình luận · 1 người được giao ·
-
Option: Benutzerdefinierte Felder auf Eindeutigkeit prüfenCó thể làm lại được @kiarn đã nhận 1502 ngày trước và không có pull request nào đang mở. Đang mởSophomorix issue
linuxmuster/linuxmuster-webui7#240 · 5 bình luận · 1 người được giao ·
Tất cả issue của linuxmuster/linuxmuster-webui7
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
notch8/iiif_print#430 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Add missing Cloud Routes keysĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
influxdata/openapi#660 ·
-
bug IIIF interoperability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100