[GH-ISSUE #3653] traffic statistics internal server error #1878

Closed
opened 2026-02-27 11:19:40 +03:00 by kerem · 3 comments
Owner

Originally created by @xinomilo on GitHub (Aug 2, 2025).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/3653

Impacted versions

  • OS Type: Debian
  • OS Version: 12.11
  • Database Type: MySQL (MariaDB)
  • Database version: 10.11.11
  • Modoboa: 2.4.9
  • installer used: No (used installer a few years ago for initial install, manually updating since..)
  • Webserver: Nginx

Steps to reproduce

open Monitoring -> Statistics ( https://example.com/admin/monitoring/statistics ) and first statistics box (average traffic) is completely blank.. same from Domains -> example.com -> Statistics tab.
internal server error produced.

Current behavior

internal server error. msg :

JSONDecodeError at /api/v2/statistics/

Invalid control character at: line 11 column 25 (char 272)

Request Method: GET
Request URL: https://example.com/api/v2/statistics/?gset=mailtraffic&period=day&graphic=averagetraffic
Django Version: 5.2.4
Exception Type: JSONDecodeError
Exception Value:

Invalid control character at: line 11 column 25 (char 272)

Exception Location: /usr/lib/python3.11/json/decoder.py, line 353, in raw_decode
Raised during: modoboa.maillog.api.v2.viewsets.StatisticsViewSet
Python Executable: /usr/bin/uwsgi-core
Python Version: 3.11.2
Python Path:

['.',
'',
'/usr/lib/python311.zip',
'/usr/lib/python3.11',
'/usr/lib/python3.11/lib-dynload',
'/srv/modoboa/env/lib/python3.11/site-packages']

Server time: Sat, 02 Aug 2025 12:14:28 +0000

uwsgi log :
example.com [pid: 2967960|app: 1|req: 82/549] 149.102.246.5 () {58 vars in 1135 bytes} [Sat Aug 2 15:14:27 2025] GET /api/v2/statistics/?gset=accountgraphicset&period=day&graphic=accountcreationgraphic => generated 1715 bytes in 24 msecs (HTTP/2.0 200) 6 headers in 190 bytes (1 switches on core 0)
example.com [pid: 2967963|app: 1|req: 144/550] 149.102.246.5 () {58 vars in 1115 bytes} [Sat Aug 2 15:14:27 2025] GET /api/v2/statistics/?gset=mailtraffic&period=day&graphic=averagetrafficsize => generated 22603 bytes in 30 msecs (HTTP/2.0 200) 6 headers in 191 bytes (1 switches on core 0)
example.com [pid: 3129745|app: 1|req: 76/551] 149.102.246.5 () {58 vars in 1107 bytes} [Sat Aug 2 15:14:27 2025] GET /api/v2/statistics/?gset=mailtraffic&period=day&graphic=averagetraffic => generated 566 bytes in 762 msecs (HTTP/2.0 500) 5 headers in 181 bytes (1 switches on core 0)

Expected behavior

show traffic statistics normally.

Image
Originally created by @xinomilo on GitHub (Aug 2, 2025). Original GitHub issue: https://github.com/modoboa/modoboa/issues/3653 # Impacted versions * OS Type: Debian * OS Version: 12.11 * Database Type: MySQL (MariaDB) * Database version: 10.11.11 * Modoboa: 2.4.9 * installer used: No (used installer a few years ago for initial install, manually updating since..) * Webserver: Nginx # Steps to reproduce open Monitoring -> Statistics ( https://example.com/admin/monitoring/statistics ) and first statistics box (average traffic) is completely blank.. same from Domains -> example.com -> Statistics tab. internal server error produced. # Current behavior internal server error. msg : JSONDecodeError at /api/v2/statistics/ Invalid control character at: line 11 column 25 (char 272) Request Method: GET Request URL: https://example.com/api/v2/statistics/?gset=mailtraffic&period=day&graphic=averagetraffic Django Version: 5.2.4 Exception Type: JSONDecodeError Exception Value: Invalid control character at: line 11 column 25 (char 272) Exception Location: /usr/lib/python3.11/json/decoder.py, line 353, in raw_decode Raised during: modoboa.maillog.api.v2.viewsets.StatisticsViewSet Python Executable: /usr/bin/uwsgi-core Python Version: 3.11.2 Python Path: ['.', '', '/usr/lib/python311.zip', '/usr/lib/python3.11', '/usr/lib/python3.11/lib-dynload', '/srv/modoboa/env/lib/python3.11/site-packages'] Server time: Sat, 02 Aug 2025 12:14:28 +0000 uwsgi log : example.com [pid: 2967960|app: 1|req: 82/549] 149.102.246.5 () {58 vars in 1135 bytes} [Sat Aug 2 15:14:27 2025] GET /api/v2/statistics/?gset=accountgraphicset&period=day&graphic=accountcreationgraphic => generated 1715 bytes in 24 msecs (HTTP/2.0 200) 6 headers in 190 bytes (1 switches on core 0) example.com [pid: 2967963|app: 1|req: 144/550] 149.102.246.5 () {58 vars in 1115 bytes} [Sat Aug 2 15:14:27 2025] GET /api/v2/statistics/?gset=mailtraffic&period=day&graphic=averagetrafficsize => generated 22603 bytes in 30 msecs (HTTP/2.0 200) 6 headers in 191 bytes (1 switches on core 0) example.com [pid: 3129745|app: 1|req: 76/551] 149.102.246.5 () {58 vars in 1107 bytes} [Sat Aug 2 15:14:27 2025] GET /api/v2/statistics/?gset=mailtraffic&period=day&graphic=averagetraffic => generated 566 bytes in 762 msecs (HTTP/2.0 500) 5 headers in 181 bytes (1 switches on core 0) # Expected behavior show traffic statistics normally. <img width="1617" height="154" alt="Image" src="https://github.com/user-attachments/assets/d7a6b3b5-f220-4ced-8925-b798c2543aee" />
kerem closed this issue 2026-02-27 11:19:40 +03:00
Author
Owner

@xinomilo commented on GitHub (Aug 2, 2025):

found this patch : https://github.com/modoboa/modoboa/issues/3186#issuecomment-2451668793
from similar issue ... been trying it now, will update issue here, if something changes..

<!-- gh-comment-id:3146538744 --> @xinomilo commented on GitHub (Aug 2, 2025): found this patch : https://github.com/modoboa/modoboa/issues/3186#issuecomment-2451668793 from similar issue ... been trying it now, will update issue here, if something changes..
Author
Owner

@tonioo commented on GitHub (Aug 19, 2025):

@xinomilo Your trace is not really useful. Could you send a complete one?

<!-- gh-comment-id:3200758251 --> @tonioo commented on GitHub (Aug 19, 2025): @xinomilo Your trace is not really useful. Could you send a complete one?
Author
Owner

@xinomilo commented on GitHub (Aug 21, 2025):

hey @tonioo ,
not sure when behavior changed (sometime during the past 2 weeks probably), but this seems to work ok now... (?!)
just tried to recheck in order to find more details, and statistics page is working properly now.
so closing it for now.
thx!

<!-- gh-comment-id:3209762032 --> @xinomilo commented on GitHub (Aug 21, 2025): hey @tonioo , not sure when behavior changed (sometime during the past 2 weeks probably), but this seems to work ok now... (?!) just tried to recheck in order to find more details, and statistics page is working properly now. so closing it for now. thx!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1878
No description provided.