mailgraph CGI failing to render

Bug #4220 reported by Kevin Otte on 2005-11-11
8
Affects Status Importance Assigned to Milestone
mailgraph (Ubuntu)
Medium
Daniel T Chen

Bug Description

Going to the mailgraph page fails to display any graphs, and the following is present in the error_log:

[Fri Nov 11 14:40:44 2005] [error] [client 172.27.1.3] Premature end of script headers: /usr/lib/cgi-bin/mailgraph.cgi
ERROR: Garbage ':40:45 2005]\l' after command:
COMMENT:[Fri Nov 11 14:40:45 2005]\l

This is in Ubuntu 5.10

Changed in mailgraph:
assignee: nobody → motu
Kevin Otte (nivex) wrote :

The following is provided by Ian Kilgore <email address hidden>:

The problem line is this:

'COMMENT:['.localtime(time).']\l',

The commands to librrds are delimted by colons, localtime (in scalar
context) returns a string with several colons (hour:minute:second).
librrds on sarge swallows the colons fine (for the COMMENT field), the Ubuntu version does not.

Patch for ubuntu version:

--- mailgraph.cgi 2005-12-22 11:51:48.000000000 -0500
+++ mailgraph.cgi.orig 2005-12-22 11:51:31.000000000 -0500
@@ -18,8 +18,6 @@
 my $rrd = '/var/lib/mailgraph/mailgraph.rrd'; # path to where the RRD database is
 my $rrd_virus = '/var/lib/mailgraph/mailgraph_virus.rrd'; # path to where the Virus RRD database is
 my $tmp_dir = '/var/lib/mailgraph'; # temporary directory where to store the images
-my $curtime = localtime(time);
-$curtime =~ s/:/-/g;

 my @graphs = (
        { title => 'Day Graphs', seconds => 3600*24, },
@@ -80,7 +78,7 @@
                'GPRINT:rrecv:AVERAGE:avg\: %5.2lf msgs/min',
                'GPRINT:rmrecv:MAX:max\: %4.0lf msgs/min',

- 'COMMENT:['.$curtime.']\l',
+ 'COMMENT:['.localtime(time).']\l',
        );
        my $ERR=RRDs::error;
        die "ERROR: $ERR\n" if $ERR;
@@ -150,7 +148,7 @@
                'GPRINT:rspam:AVERAGE:avg\: %5.2lf msgs/min',
                'GPRINT:rmspam:MAX:max\: %4.0lf msgs/min',

- 'COMMENT:['.$curtime.']\l',
+ 'COMMENT:['.localtime(time).']\l',
        );
        my $ERR=RRDs::error;
        die "ERROR: $ERR\n" if $ERR;

Daniel T Chen (crimsun) on 2006-03-29
Changed in mailgraph:
assignee: motu → crimsun
Daniel T Chen (crimsun) wrote :

Should be fixed in dapper's version.

Changed in mailgraph:
status: Unconfirmed → Needs Info
Daniel T Chen (crimsun) wrote :

If Jason reports back on this issue (which is fixed in the version in Dapper), he should reopen.

Changed in mailgraph:
status: Needs Info → Rejected
Rolf Leggewie (r0lf) wrote :

I just had this exact same problem on edgy. I found the following log line to be more interesting than the one originally provided.

ERROR: opening '/var/lib/mailgraph/mailgraph.rrd': No such file or directory, referer: http://rie/cgi-bin/mailgraph.cgi

Changed in mailgraph:
status: Rejected → Confirmed
Antonio (netbix) wrote :

In feisty i have same problem.
On /var/lib/mailgraph directory i have found this:

/var/lib/mailgraph/,cgi-bin

??

queuegraph work well

Rolf Leggewie (r0lf) wrote :

works fine for me in gutsy now. How is the situation for everybody else?

Changed in mailgraph:
status: Confirmed → Incomplete
Daniel T Chen (crimsun) wrote :

Fixed in 7.10 and newer.

Changed in mailgraph:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers