Closed Bug 289627 Opened 19 years ago Closed 17 years ago

Chart report crashes when there is no series data to plot

Categories

(Bugzilla :: Reporting/Charting, defect)

2.21
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.22

People

(Reporter: sfurt, Assigned: LpSolit)

References

()

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2

I manage to generate a chart using a data set when I am not using the data range
option. However, when specifying a date range, the chart does not appear and the
error displayed on the screen is:
Internal Error  	

Bugzilla has suffered an internal error. Please save this page and send it to
the administrator with details of what you were doing at the time this message
appeared.

undef error - Usage: GD::Image::line(image, x1, y1, x2, y2, color) at
C:/Perl/site/lib/GD.pm line 372.

Reproducible: Always

Steps to Reproduce:
1. Generate a chart using a date range





Here is the entire error page

Bugzilla::Chart object:
$VAR1 = bless( {
                 'datefrom' => '1107234000',
                 'cumulate' => 1,
                 '_data' => [
                              [
                                '2005-02-01',
                                '2005-02-02',
                                '2005-02-03',
                                '2005-02-04',
                                '2005-02-05',
                                '2005-02-06',
                                '2005-02-07',
                                '2005-02-08',
                                '2005-02-09',
                                '2005-02-10',
                                '2005-02-11',
                                '2005-02-12',
                                '2005-02-13',
                                '2005-02-14',
                                '2005-02-15',
                                '2005-02-16',
                                '2005-02-17',
                                '2005-02-18',
                                '2005-02-19',
                                '2005-02-20',
                                '2005-02-21',
                                '2005-02-22',
                                '2005-02-23',
                                '2005-02-24',
                                '2005-02-25',
                                '2005-02-26',
                                '2005-02-27',
                                '2005-02-28',
                                '2005-03-01',
                                '2005-03-02',
                                '2005-03-03',
                                '2005-03-04',
                                '2005-03-05',
                                '2005-03-06',
                                '2005-03-07',
                                '2005-03-08',
                                '2005-03-09',
                                '2005-03-10',
                                '2005-03-11',
                                '2005-03-12',
                                '2005-03-13',
                                '2005-03-14',
                                '2005-03-15',
                                '2005-03-16',
                                '2005-03-17',
                                '2005-03-18',
                                '2005-03-19',
                                '2005-03-20',
                                '2005-03-21',
                                '2005-03-22',
                                '2005-03-23',
                                '2005-03-24',
                                '2005-03-25',
                                '2005-03-26',
                                '2005-03-27',
                                '2005-03-28',
                                '2005-03-29',
                                '2005-03-30',
                                '2005-03-31',
                                '2005-04-01',
                                '2005-04-02',
                                '2005-04-03',
                                '2005-04-04',
                                '2005-04-05',
                                '2005-04-06',
                                '2005-04-07'
                              ],
                              []
                            ],
                 'dateto' => '1112846400',
                 'labelgt' => undef,
                 'gt' => 0,
                 'lines' => [
                              [
                                bless( {
                                         'creator' => '5',
                                         'query' =>
'bug_file_loc_type=allwordssubstr&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&bugidtype=include&chfieldto=Now&component=ZC&emailassigned_to1=1&emailassigned_to2=1&emailcc2=1&emailqa_contact2=1&emailreporter2=1&emailtype1=substring&emailtype2=substring&field0-0-0=noop&long_desc_type=substring&product=DCOZ%20IZIS&short_desc_type=allwordssubstr&submit-button=Create%20Data%20Set&type0-0-0=noop',
                                         'name' => 'Zc closed bugs',
                                         'series_id' => '90',
                                         'subcategory' => 'ZC closed bugs',
                                         'frequency' => '7',
                                         'public' => '0',
                                         'category' => 'Sylvain'
                                       }, 'Bugzilla::Series' )
                              ]
                            ],
                 'labels' => [
                               'Zc closed bugs'
                             ]
               }, 'Bugzilla::Chart' );

This is Bugzilla

Bugzilla Version 2.18
Internal Error
	  	

Bugzilla has suffered an internal error. Please save this page and send it to
sfurt@ostglobal.com with details of what you were doing at the time this message
appeared.

URL:
http://erie:88/chart.cgi?category=-All-&cumulate=1&datefrom=2005-02-01&dateto=2005-04-7&label0=Zc%20closed%20bugs&line0=90&name=32&subcategory=-All-&ctype=png&action=plot&width=600&height=350&debug=1

undef error - Usage: GD::Image::line(image, x1, y1, x2, y2, color) at
C:/Perl/site/lib/GD.pm line 372.
sylvain: are you able to reproduce this problem on a public Bugzilla (e.g.
bugzilla.mozilla.org) and provide a URL?

Gerv
Gerv,
Our bugzilla is deployed on the Intranet of our company only so I cannot provide
an URL for it. However, I tried to reproduce the bug on a different Bugzilla
(such as RedHat or bugzilla.mozilla.org) but I do not have access to the New
charts module. Sorry, it is not really helpful.
The bug is actually really simple to produce. I just created a new Data Set by
querying all closed and verified bugs of one project and one of its component
(the associated search retrieves 12 items) and tried to create a chart from it
over a period of one month.
Actually, I just tried that this morning and I have a MySQL Syntax Error.
Can you tell me if this module is still under development? Should I should just
wait for it to be stable in the next versions to use it?
Have you tried to use landfill to reproduce this?
http://landfill.bugzilla.org
I managed to reproduced the bug on Landfill.

here is the address of the page displaying the error:
http://landfill.bugzilla.org/bugzilla-2.18-branch/chart.cgi?category=-All-&cumulate=1&datefrom=2005-03-01&dateto=2005-03-31&label0=Opened%20Bugs&line0=105&name=80&select0=1&subcategory=-All-&ctype=png&action=plot&width=600&height=350&debug=1

I also attached a copy of the page that generated the report.

Thanks.
This URL does, in fact, produce an SQL error.
Status: UNCONFIRMED → NEW
Ever confirmed: true
It gives SQL errors because there are no chart IDs. There are no chart IDs
because the one ID in the URL is not visible to the people doing the testing. So
there's a bug that it's displayed, and another one that it causes a crash.

Gerv
I just triggered the internal error described in comment #0. It seems to happen when there is only date data points but no value data points in the _data array. This happened when one of my series had no data in series_data table.

I also got a SQL error when I didn't specify a date range because then readData sub in Bugzilla/Chart.pm tried to use an empty value for the FROM_UNIXTIME().
OS: Windows 2000 → All
Hardware: PC → All
Summary: Chart module crash when using date range → Chart report crashes when there is no series data to plot
Version: unspecified → 2.21
An easy way to crash bugzilla is to call https://bugzilla.mozilla.org/chart.cgi?debug=1

DBD::mysql::db selectrow_array failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 [for Statement "SELECT MIN(series_date) FROM series_data WHERE series_id IN ()"] at /opt/webtools/bugzilla/Bugzilla/Chart.pm line 226
	Bugzilla::Chart::readData('Bugzilla::Chart=HASH(0xb583d98)') called at /opt/webtools/bugzilla/Bugzilla/Chart.pm line 207
	Bugzilla::Chart::data('Bugzilla::Chart=HASH(0xb583d98)') called at /opt/webtools/bugzilla/Bugzilla/Chart.pm line 437
	Bugzilla::Chart::dump('Bugzilla::Chart=HASH(0xb583d98)') called at /opt/webtools/bugzilla/chart.cgi line 320
	ModPerl::ROOT::Bugzilla::ModPerl::ResponseHandler::opt_webtools_bugzilla_chart_2ecgi::view('Bugzilla::Chart=HASH(0xb583d98)') called at /opt/webtools/bugzilla/chart.cgi line 124
	ModPerl::ROOT::Bugzilla::ModPerl::ResponseHandler::opt_webtools_bugzilla_chart_2ecgi::handler('Apache2::RequestRec=SCALAR(0xb066e2c)') called at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/ModPerl/RegistryCooker.pm line 203
	eval {...} called at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/ModPerl/RegistryCooker.pm line 203
	ModPerl::RegistryCooker::run('Bugzilla::ModPerl::ResponseHandler=HASH(0xb707a7c)') called at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/ModPerl/RegistryCooker.pm line 169
	ModPerl::RegistryCooker::default_handler('Bugzilla::ModPerl::ResponseHandler=HASH(0xb707a7c)') called at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/ModPerl/Registry.pm line 30
	ModPerl::Registry::handler('Bugzilla::ModPerl::ResponseHandler', 'Apache2::RequestRec=SCALAR(0xb066e2c)') called at /opt/webtools/bugzilla/mod_perl.pl line 92
	Bugzilla::ModPerl::ResponseHandler::handler('Bugzilla::ModPerl::ResponseHandler', 'Apache2::RequestRec=SCALAR(0xb066e2c)') called at -e line 0
	eval {...} called at -e line 0


On a non mod_perl installation, the error reduces to:

DBD::mysql::db selectrow_array failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 [for Statement "SELECT MIN(series_date) FROM series_data WHERE series_id IN ()"] at Bugzilla/Chart.pm line 226
	Bugzilla::Chart::readData('Bugzilla::Chart=HASH(0x9d04b30)') called at Bugzilla/Chart.pm line 207
	Bugzilla::Chart::data('Bugzilla::Chart=HASH(0x9d04b30)') called at Bugzilla/Chart.pm line 437
	Bugzilla::Chart::dump('Bugzilla::Chart=HASH(0x9d04b30)') called at /var/www/html/qa30/chart.cgi line 320
	main::view('Bugzilla::Chart=HASH(0x9d04b30)') called at /var/www/html/qa30/chart.cgi line 124
Target Milestone: --- → Bugzilla 2.22
Attached patch patch, v1Splinter Review
Assignee: gerv → LpSolit
Status: NEW → ASSIGNED
Attachment #255634 - Flags: review?(wicked+bz)
Attachment #255634 - Flags: review?(gerv)
Comment on attachment 255634 [details] [diff] [review]
patch, v1

You need to change the comment three lines above as well.

What happens when we do this? Does the series appear on the legend but no line on the chart? I think that would be the most appropriate behaviour.

Gerv
Comment on attachment 255634 [details] [diff] [review]
patch, v1

OK. As a band-aid to stop an SQL error, it'll do. But we need to handle this case better. Can you please open another bug on "Need to do the right thing when a series has no data points"?

Thanks :-)

Gerv
Attachment #255634 - Flags: review?(gerv) → review+
Flags: approval2.22+
Flags: approval+
Attachment #255634 - Flags: review?(wicked+bz)
tip:

Checking in Bugzilla/Chart.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Chart.pm,v  <--  Chart.pm
new revision: 1.15; previous revision: 1.14
done

2.22.2:

Checking in Bugzilla/Chart.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Chart.pm,v  <--  Chart.pm
new revision: 1.11.2.1; previous revision: 1.11
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: