[GH-ISSUE #661] Statistics 1.2.0-rc2 no curves in returned JSON #621

Closed
opened 2026-02-27 11:12:42 +03:00 by kerem · 11 comments
Owner

Originally created by @smarek on GitHub (Dec 19, 2014).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/661

error in javascript console
Uncaught TypeError: Cannot read property 'data' of undefined graphic.js:60

lines in graphic.js file

59: x.domain(
60:    d3.extent(data.curves[0].data.map(function(d) { return d.x * 1000; }))
61: );

And in JSON data returned by GET /stats/graphs/?gset=mailtraffic
params averagetraffic and averagetrafficsize has curves as empty array

RRD files are in /tmp/modoboa with user/group the same as apache/wsgi user, two RRD files non-zero size, nothing else

Originally created by @smarek on GitHub (Dec 19, 2014). Original GitHub issue: https://github.com/modoboa/modoboa/issues/661 error in javascript console `Uncaught TypeError: Cannot read property 'data' of undefined graphic.js:60` lines in graphic.js file ``` javascript 59: x.domain( 60: d3.extent(data.curves[0].data.map(function(d) { return d.x * 1000; })) 61: ); ``` And in JSON data returned by `GET /stats/graphs/?gset=mailtraffic` params `averagetraffic` and `averagetrafficsize` has curves as empty array RRD files are in `/tmp/modoboa` with user/group the same as apache/wsgi user, two RRD files non-zero size, nothing else
kerem closed this issue 2026-02-27 11:12:42 +03:00
Author
Owner

@smarek commented on GitHub (Dec 19, 2014):

In fact, I can see the same issue on demo, http://modoboa.sys4.de/stats/#graphs/?gset=mailtraffic logged in as admin, so it's known upstream bug probably?

<!-- gh-comment-id:67697997 --> @smarek commented on GitHub (Dec 19, 2014): In fact, I can see the same issue on demo, http://modoboa.sys4.de/stats/#graphs/?gset=mailtraffic logged in as admin, so it's known upstream bug probably?
Author
Owner

@tonioo commented on GitHub (Dec 20, 2014):

Actually this issue triggers when there is no data to show... (which is the case of the demo since there is no mail traffic on it)

<!-- gh-comment-id:67729634 --> @tonioo commented on GitHub (Dec 20, 2014): Actually this issue triggers when there is no data to show... (which is the case of the demo since there is no mail traffic on it)
Author
Owner

@smarek commented on GitHub (Dec 20, 2014):

Which seems strange to me, as the server is under quite heavy load (10+ domains, 100+ email accounts, 10000+ emails a day), RRD files are non-zero, but the server returns no data to show in statistics?

Is it possible that modoboa is looking for RRD files in another location? I've tried to run it directly, instead of WSGI apache wrapper, and turning on debug and template debug, however no issues appeared in logs at all.

<!-- gh-comment-id:67736417 --> @smarek commented on GitHub (Dec 20, 2014): Which seems strange to me, as the server is under quite heavy load (10+ domains, 100+ email accounts, 10000+ emails a day), RRD files are non-zero, but the server returns no data to show in statistics? Is it possible that modoboa is looking for RRD files in another location? I've tried to run it directly, instead of WSGI apache wrapper, and turning on debug and template debug, however no issues appeared in logs at all.
Author
Owner

@tonioo commented on GitHub (Dec 21, 2014):

Modoboa will look at the location you configured through the admin panel. Have you properly configured this part ?

<!-- gh-comment-id:67768921 --> @tonioo commented on GitHub (Dec 21, 2014): Modoboa will look at the location you configured through the admin panel. Have you properly configured this part ?
Author
Owner

@smarek commented on GitHub (Dec 21, 2014):

Yes, the path /tmp/modoboa/ matches the application settings. Folder contains global.rrd and for each active domain domain.tld.rrd, with permissions that allow global read and execute on path. Is there something I'm missing?

<!-- gh-comment-id:67770222 --> @smarek commented on GitHub (Dec 21, 2014): Yes, the path `/tmp/modoboa/` matches the application settings. Folder contains `global.rrd` and for each active domain `domain.tld.rrd`, with permissions that allow global read and execute on path. Is there something I'm missing?
Author
Owner

@tonioo commented on GitHub (Dec 21, 2014):

Have you tried with fix I pushed for #660 ?

<!-- gh-comment-id:67770651 --> @tonioo commented on GitHub (Dec 21, 2014): Have you tried with fix I pushed for #660 ?
Author
Owner

@smarek commented on GitHub (Dec 21, 2014):

Yes, with current upstream version, the statistics suffer from the same issue

<!-- gh-comment-id:67770815 --> @smarek commented on GitHub (Dec 21, 2014): Yes, with current upstream version, the statistics suffer from the same issue
Author
Owner

@tonioo commented on GitHub (Dec 21, 2014):

One more check: have you installed the rrdtool binary ?

<!-- gh-comment-id:67774402 --> @tonioo commented on GitHub (Dec 21, 2014): One more check: have you installed the rrdtool binary ?
Author
Owner

@smarek commented on GitHub (Dec 21, 2014):

As documentation states apt-get install python-rrdtool, yes, I've done that.
I suppose, output of python manage.py logparser wouldn't include output such as [rrd] VERBOSE events at 1419176640 already recorded in RRD if I didn't do so

<!-- gh-comment-id:67774497 --> @smarek commented on GitHub (Dec 21, 2014): As documentation states `apt-get install python-rrdtool`, yes, I've done that. I suppose, output of `python manage.py logparser` wouldn't include output such as `[rrd] VERBOSE events at 1419176640 already recorded in RRD` if I didn't do so
Author
Owner

@tonioo commented on GitHub (Dec 21, 2014):

I'm talking about rrdtool, not the python module:

$ apt-get install rrdtool

I should complete the documentation.

<!-- gh-comment-id:67777508 --> @tonioo commented on GitHub (Dec 21, 2014): I'm talking about rrdtool, not the python module: ``` bash $ apt-get install rrdtool ``` I should complete the documentation.
Author
Owner

@smarek commented on GitHub (Dec 21, 2014):

Well, that solved the issue ! Thank you a lot, this should definitely be in documentation.

<!-- gh-comment-id:67778354 --> @smarek commented on GitHub (Dec 21, 2014): Well, that solved the issue ! Thank you a lot, this should definitely be in documentation.
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#621
No description provided.