[GH-ISSUE #653] Statistiques on v1.2.0-rc1 #612

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

Originally created by @ghost on GitHub (Dec 12, 2014).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/653

Hello,
After a fresh install of modoboa on debian 7.7, i've this error when i want to see Graphical Stats :

[Fri Dec 12 14:04:46 2014] [error] Internal Server Error: /stats/graphs/
[Fri Dec 12 14:04:46 2014] [error] Traceback (most recent call last):
[Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 112, in get_response
[Fri Dec 12 14:04:46 2014] [error] response = wrapped_callback(request, _callback_args, *_callback_kwargs)
[Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py", line 22, in _wrapped_view
[Fri Dec 12 14:04:46 2014] [error] return view_func(request, _args, *_kwargs)
[Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py", line 22, in _wrapped_view
[Fri Dec 12 14:04:46 2014] [error] return view_func(request, _args, *_kwargs)
[Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/stats/views.py", line 110, in graphs
[Fri Dec 12 14:04:46 2014] [error] tplvars['graphs'] = gsets[gset].export(tplvars["domain"], start, end)
[Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/stats/graphics.py", line 146, in export
[Fri Dec 12 14:04:46 2014] [error] "curves": graph.export(rrdfile, start, end)
[Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/stats/graphics.py", line 79, in export
[Fri Dec 12 14:04:46 2014] [error] code, output = exec_cmd(cmd)
[Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/modoboa/lib/sysutils.py", line 32, in exec_cmd
[Fri Dec 12 14:04:46 2014] [error] process = subprocess.Popen(cmd, **kwargs)
[Fri Dec 12 14:04:46 2014] [error] File "/usr/lib/python2.7/subprocess.py", line 679, in init
[Fri Dec 12 14:04:46 2014] [error] errread, errwrite)
[Fri Dec 12 14:04:46 2014] [error] File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
[Fri Dec 12 14:04:46 2014] [error] raise child_exception
[Fri Dec 12 14:04:46 2014] [error] TypeError: execv() arg 2 must contain only strings

Crontab for RRD created, RRD files created, directory of RRD in modoboa is correct.

Thanks

Originally created by @ghost on GitHub (Dec 12, 2014). Original GitHub issue: https://github.com/modoboa/modoboa/issues/653 Hello, After a fresh install of modoboa on debian 7.7, i've this error when i want to see Graphical Stats : [Fri Dec 12 14:04:46 2014] [error] Internal Server Error: /stats/graphs/ [Fri Dec 12 14:04:46 2014] [error] Traceback (most recent call last): [Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 112, in get_response [Fri Dec 12 14:04:46 2014] [error] response = wrapped_callback(request, _callback_args, *_callback_kwargs) [Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py", line 22, in _wrapped_view [Fri Dec 12 14:04:46 2014] [error] return view_func(request, _args, *_kwargs) [Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py", line 22, in _wrapped_view [Fri Dec 12 14:04:46 2014] [error] return view_func(request, _args, *_kwargs) [Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/stats/views.py", line 110, in graphs [Fri Dec 12 14:04:46 2014] [error] tplvars['graphs'] = gsets[gset].export(tplvars["domain"], start, end) [Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/stats/graphics.py", line 146, in export [Fri Dec 12 14:04:46 2014] [error] "curves": graph.export(rrdfile, start, end) [Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/stats/graphics.py", line 79, in export [Fri Dec 12 14:04:46 2014] [error] code, output = exec_cmd(cmd) [Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/modoboa/lib/sysutils.py", line 32, in exec_cmd [Fri Dec 12 14:04:46 2014] [error] process = subprocess.Popen(cmd, **kwargs) [Fri Dec 12 14:04:46 2014] [error] File "/usr/lib/python2.7/subprocess.py", line 679, in __init__ [Fri Dec 12 14:04:46 2014] [error] errread, errwrite) [Fri Dec 12 14:04:46 2014] [error] File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child [Fri Dec 12 14:04:46 2014] [error] raise child_exception [Fri Dec 12 14:04:46 2014] [error] TypeError: execv() arg 2 must contain only strings Crontab for RRD created, RRD files created, directory of RRD in modoboa is correct. Thanks
kerem closed this issue 2026-02-27 11:12:38 +03:00
Author
Owner

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

You're not the first one to report this issue (see #646). Is it still failing?

<!-- gh-comment-id:66788906 --> @tonioo commented on GitHub (Dec 12, 2014): You're not the first one to report this issue (see #646). Is it still failing?
Author
Owner

@ghost commented on GitHub (Dec 12, 2014):

i've rrdtool installed (rrdtool_1.4.7-2_amd64.deb), still failing.
directory /srv/vmail/vmail/media/stats still empty and /srv/vmail/vmail/media/stats/graphs not exists.

<!-- gh-comment-id:66791323 --> @ghost commented on GitHub (Dec 12, 2014): i've rrdtool installed (rrdtool_1.4.7-2_amd64.deb), still failing. directory /srv/vmail/vmail/media/stats still empty and /srv/vmail/vmail/media/stats/graphs not exists.
Author
Owner

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

The media/stats directory is not used anymore. The graphs directory is the one you configured to store RRD files ?
Have you setup the cron job ?

<!-- gh-comment-id:66792068 --> @tonioo commented on GitHub (Dec 12, 2014): The media/stats directory is not used anymore. The graphs directory is the one you configured to store RRD files ? Have you setup the cron job ?
Author
Owner

@ghost commented on GitHub (Dec 12, 2014):

Ok for media stats.
My crontab :
*/5 * * * * /srv/vmail/manage.py logparser &> /dev/null

RRD directory in modoboa : /var/lib/modoboa/rrd
content of this dir :
-rw-r--r-- 1 root root 107K déc. 12 16:40 boiteamail.net.rrd
-rw-r--r-- 1 root root 107K déc. 12 16:40 global.rrd
-rw-r--r-- 1 root root 107K déc. 11 18:25 gryfon.eu.rrd
-rw-r--r-- 1 root root 107K déc. 12 16:35 mon-mail.eu.rrd
-rw-r--r-- 1 root root 107K déc. 11 18:25 tribal-dolphin.eu.rrd

Sorry for the mistake, i think media/stats/graphs is created by modoboa cause i see this message : Internal Server Error: /stats/graphs/ :-)

<!-- gh-comment-id:66793794 --> @ghost commented on GitHub (Dec 12, 2014): Ok for media stats. My crontab : */5 \* \* \* \* /srv/vmail/manage.py logparser &> /dev/null RRD directory in modoboa : /var/lib/modoboa/rrd content of this dir : -rw-r--r-- 1 root root 107K déc. 12 16:40 boiteamail.net.rrd -rw-r--r-- 1 root root 107K déc. 12 16:40 global.rrd -rw-r--r-- 1 root root 107K déc. 11 18:25 gryfon.eu.rrd -rw-r--r-- 1 root root 107K déc. 12 16:35 mon-mail.eu.rrd -rw-r--r-- 1 root root 107K déc. 11 18:25 tribal-dolphin.eu.rrd Sorry for the mistake, i think media/stats/graphs is created by modoboa cause i see this message : Internal Server Error: /stats/graphs/ :-)
Author
Owner

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

Is there any traffic on your server ? Have selected a custom time period or something else ?

<!-- gh-comment-id:66795685 --> @tonioo commented on GitHub (Dec 12, 2014): Is there any traffic on your server ? Have selected a custom time period or something else ?
Author
Owner

@ghost commented on GitHub (Dec 12, 2014):

Yes, it have mail traffic on 2 domains.
global.rrd and .rrd updated today at 17:55. another .rrd updated today at 17:50

Same error with or without custom period or when i type a domain name in the textbox.

<!-- gh-comment-id:66801137 --> @ghost commented on GitHub (Dec 12, 2014): Yes, it have mail traffic on 2 domains. global.rrd and <domain>.rrd updated today at 17:55. another <domain>.rrd updated today at 17:50 Same error with or without custom period or when i type a domain name in the textbox.
Author
Owner

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

Do you know python/django ?

<!-- gh-comment-id:66805327 --> @tonioo commented on GitHub (Dec 12, 2014): Do you know python/django ?
Author
Owner

@ghost commented on GitHub (Dec 12, 2014):

I'm a beginner in python/Django. I usually work in php.

<!-- gh-comment-id:66806240 --> @ghost commented on GitHub (Dec 12, 2014): I'm a beginner in python/Django. I usually work in php.
Author
Owner

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

According to the exception that is raised in the stacktrace you pasted, there is something wrong with command I try to execute using Popen (or excev in the end). It would be helpful if I could dump this command.

The interesing line is:

[Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/stats/graphics.py", line 79, in export
[Fri Dec 12 14:04:46 2014] [error] code, output = exec_cmd(cmd)

I need the content of cmd. How did you receive this error? Into you browser or by email?

<!-- gh-comment-id:66807659 --> @tonioo commented on GitHub (Dec 12, 2014): According to the exception that is raised in the stacktrace you pasted, there is something wrong with command I try to execute using Popen (or excev in the end). It would be helpful if I could dump this command. The interesing line is: ``` python [Fri Dec 12 14:04:46 2014] [error] File "/usr/local/lib/python2.7/dist-packages/modoboa/extensions/stats/graphics.py", line 79, in export [Fri Dec 12 14:04:46 2014] [error] code, output = exec_cmd(cmd) ``` I need the content of cmd. How did you receive this error? Into you browser or by email?
Author
Owner

@ghost commented on GitHub (Dec 12, 2014):

I try to get the content of the variable but no success.
No report of this error by mail, i set debug=True in settings.py but no more info, juste a red message "erreur interne".
The stacktrace is from apache error log. Additionaly i've this in the access log :
[12/Dec/2014:19:37:51 +0100] "GET /stats/graphs/?gset=mailtraffic&_=1418409469508 HTTP/1.1" 500 4535

<!-- gh-comment-id:66815357 --> @ghost commented on GitHub (Dec 12, 2014): I try to get the content of the variable but no success. No report of this error by mail, i set debug=True in settings.py but no more info, juste a red message "erreur interne". The stacktrace is from apache error log. Additionaly i've this in the access log : [12/Dec/2014:19:37:51 +0100] "GET /stats/graphs/?gset=mailtraffic&_=1418409469508 HTTP/1.1" 500 4535
Author
Owner

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

Can you remove the # character inside the URL and try again? You should see a dynamic stack...

<!-- gh-comment-id:66819830 --> @tonioo commented on GitHub (Dec 12, 2014): Can you remove the # character inside the URL and try again? You should see a dynamic stack...
Author
Owner

@ghost commented on GitHub (Dec 12, 2014):

graphics.py", line 79
cmd
u'rrdtool xport --start -1day --end 1418416726 DEF:reject=/var/lib/modoboa/rrd/global.rrd:reject:AVERAGE CDEF:rejectpm=reject,60,* XPORT:rejectpm:"messages rejet\xe9s" DEF:bounced=/var/lib/modoboa/rrd/global.rrd:bounced:AVERAGE CDEF:bouncedpm=bounced,60,* XPORT:bouncedpm:"messages non remis" DEF:recv=/var/lib/modoboa/rrd/global.rrd:recv:AVERAGE CDEF:recvpm=recv,60,* XPORT:recvpm:"messages re\xe7us" DEF:sent=/var/lib/modoboa/rrd/global.rrd:sent:AVERAGE CDEF:sentpm=sent,60,* XPORT:sentpm:"messages envoy\xe9s"'

cmdargs
[u'DEF:reject=/var/lib/modoboa/rrd/global.rrd:reject:AVERAGE',
'CDEF:rejectpm=reject,60,',
u'XPORT:rejectpm:"messages rejet\xe9s"',
u'DEF:bounced=/var/lib/modoboa/rrd/global.rrd:bounced:AVERAGE',
'CDEF:bouncedpm=bounced,60,
',
u'XPORT:bouncedpm:"messages non remis"',
u'DEF:recv=/var/lib/modoboa/rrd/global.rrd:recv:AVERAGE',
'CDEF:recvpm=recv,60,',
u'XPORT:recvpm:"messages re\xe7us"',
u'DEF:sent=/var/lib/modoboa/rrd/global.rrd:sent:AVERAGE',
'CDEF:sentpm=sent,60,
',
u'XPORT:sentpm:"messages envoy\xe9s"']

sysutils.py, line 32
cmd
u'rrdtool xport --start -1day --end 1418416726 DEF:reject=/var/lib/modoboa/rrd/global.rrd:reject:AVERAGE CDEF:rejectpm=reject,60,* XPORT:rejectpm:"messages rejet\xe9s" DEF:bounced=/var/lib/modoboa/rrd/global.rrd:bounced:AVERAGE CDEF:bouncedpm=bounced,60,* XPORT:bouncedpm:"messages non remis" DEF:recv=/var/lib/modoboa/rrd/global.rrd:recv:AVERAGE CDEF:recvpm=recv,60,* XPORT:recvpm:"messages re\xe7us" DEF:sent=/var/lib/modoboa/rrd/global.rrd:sent:AVERAGE CDEF:sentpm=sent,60,* XPORT:sentpm:"messages envoy\xe9s"'

<!-- gh-comment-id:66832203 --> @ghost commented on GitHub (Dec 12, 2014): graphics.py", line 79 cmd u'rrdtool xport --start -1day --end 1418416726 DEF:reject=/var/lib/modoboa/rrd/global.rrd:reject:AVERAGE CDEF:rejectpm=reject,60,\* XPORT:rejectpm:"messages rejet\xe9s" DEF:bounced=/var/lib/modoboa/rrd/global.rrd:bounced:AVERAGE CDEF:bouncedpm=bounced,60,\* XPORT:bouncedpm:"messages non remis" DEF:recv=/var/lib/modoboa/rrd/global.rrd:recv:AVERAGE CDEF:recvpm=recv,60,\* XPORT:recvpm:"messages re\xe7us" DEF:sent=/var/lib/modoboa/rrd/global.rrd:sent:AVERAGE CDEF:sentpm=sent,60,\* XPORT:sentpm:"messages envoy\xe9s"' cmdargs [u'DEF:reject=/var/lib/modoboa/rrd/global.rrd:reject:AVERAGE', 'CDEF:rejectpm=reject,60,_', u'XPORT:rejectpm:"messages rejet\xe9s"', u'DEF:bounced=/var/lib/modoboa/rrd/global.rrd:bounced:AVERAGE', 'CDEF:bouncedpm=bounced,60,_', u'XPORT:bouncedpm:"messages non remis"', u'DEF:recv=/var/lib/modoboa/rrd/global.rrd:recv:AVERAGE', 'CDEF:recvpm=recv,60,_', u'XPORT:recvpm:"messages re\xe7us"', u'DEF:sent=/var/lib/modoboa/rrd/global.rrd:sent:AVERAGE', 'CDEF:sentpm=sent,60,_', u'XPORT:sentpm:"messages envoy\xe9s"'] sysutils.py, line 32 cmd u'rrdtool xport --start -1day --end 1418416726 DEF:reject=/var/lib/modoboa/rrd/global.rrd:reject:AVERAGE CDEF:rejectpm=reject,60,\* XPORT:rejectpm:"messages rejet\xe9s" DEF:bounced=/var/lib/modoboa/rrd/global.rrd:bounced:AVERAGE CDEF:bouncedpm=bounced,60,\* XPORT:bouncedpm:"messages non remis" DEF:recv=/var/lib/modoboa/rrd/global.rrd:recv:AVERAGE CDEF:recvpm=recv,60,\* XPORT:recvpm:"messages re\xe7us" DEF:sent=/var/lib/modoboa/rrd/global.rrd:sent:AVERAGE CDEF:sentpm=sent,60,\* XPORT:sentpm:"messages envoy\xe9s"'
Author
Owner

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

What's the locale of your server ?

<!-- gh-comment-id:66870373 --> @tonioo commented on GitHub (Dec 13, 2014): What's the locale of your server ?
Author
Owner

@ghost commented on GitHub (Dec 13, 2014):

In french, fr utf8.
I'll try to change to en and I'll tell you.

With en_US.UTF8 : same error :(

<!-- gh-comment-id:66870643 --> @ghost commented on GitHub (Dec 13, 2014): In french, fr utf8. I'll try to change to en and I'll tell you. With en_US.UTF8 : same error :(
Author
Owner

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

Could you try the fix I've just pushed please ?

<!-- gh-comment-id:66882266 --> @tonioo commented on GitHub (Dec 13, 2014): Could you try the fix I've just pushed please ?
Author
Owner

@ghost commented on GitHub (Dec 13, 2014):

Work for me.
Thanks a lot !!

<!-- gh-comment-id:66883015 --> @ghost commented on GitHub (Dec 13, 2014): Work for me. Thanks a lot !!
Author
Owner

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

Great :)

<!-- gh-comment-id:66883034 --> @tonioo commented on GitHub (Dec 13, 2014): Great :)
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#612
No description provided.