Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Illegal division by zero at nph-build.cgi line 457, chunk 1115.

Quote Reply
Illegal division by zero at nph-build.cgi line 457, chunk 1115.
grrrrr!!!

Any ideas ?


Quote:
Building Pages

Pages built on 26-Oct-1999 at 12:32:25
--------------------------------------------------------

Backing up database . . .
Backing up links, category and email database (File::Copy) ...
Done.

Building URL Index . . .
Done.

Updating New and Popular Records . . .
What's New Cutoff: 7 days
Popular Cutoff: 552 hits
Updating record: 6, marking as popular (581).
Updating record: 10, marking as popular (1034).
Updating record: 13, marking as popular (2001).
Updating record: 42, marking as popular (827).
Updating record: 54, marking as popular (701).
Updating record: 71, marking as popular (797).
Updating record: 81, marking as popular (1406).
Updating record: 82, marking as popular (1351).
Updating record: 83, marking as popular (647).
Updating record: 146, marking as popular (1116).
Updating record: 160, marking as popular (769).
Updating record: 161, marking as popular (1319).
Updating record: 171, marking as popular (841).
Updating record: 174, marking as popular (2457).
Updating record: 189, marking as popular (570).
Updating record: 195, marking as popular (668).
Updating record: 206, marking as popular (933).
Updating record: 237, marking as popular (1065).
Updating record: 336, marking as popular (719).
Updating record: 342, marking as popular (955).
Updating record: 373, marking as popular (592).
Updating record: 408, marking as popular (848).
Updating record: 461, marking as popular (1956).
Updating record: 505, marking as popular (1388).
Updating record: 511, marking as popular (823).
Updating record: 763, marking as popular (844).
Updating record: 782, marking as popular (595).
Updating record: 785, marking as popular (927).
Updating record: 821, marking as popular (1839).
Updating record: 939, marking as popular (902).
Updating record: 975, marking as popular (773).
Updating record: 980, marking as popular (1058).
Updating record: 982, marking as popular (746).
Updating record: 978, marking as popular (1147).
Updating record: 998, marking as popular (744).
Updating record: 1007, marking as popular (1253).
Updating record: 1081, marking as popular (1061).
Updating record: 1093, marking as popular (862).
Updating record: 1179, marking as popular (584).
Updating record: 1215, marking as popular (854).
Updating record: 1280, marking as popular (832).
Updating record: 1281, marking as popular (559).
Updating record: 1287, marking as popular (685).
Updating record: 1417, marking as popular (1017).
Updating record: 1429, marking as popular (1910).
Updating record: 1725, marking as popular (698).
Updating record: 1934, marking as new.
Updating record: 1935, marking as new.
Updating record: 1936, marking as new.
Updating record: 1937, marking as new.
Updating record: 1938, marking as new.
Done.

Updating ratings ..
Updating rating to 8.57 for link id 8
Updating rating to 7.75 for link id 54
Updating rating to 6.00 for link id 84
Updating rating to 8.00 for link id 91
Updating rating to 3.33 for link id 100
Updating rating to 7.25 for link id 146
Updating rating to 8.50 for link id 171
Updating rating to 7.47 for link id 204
Updating rating to 7.08 for link id 206
Updating rating to 8.45 for link id 285
Updating rating to 6.56 for link id 305
Updating rating to 7.00 for link id 448
Updating rating to 9.50 for link id 698
Updating rating to 6.00 for link id 700
Updating rating to 6.33 for link id 773
Updating rating to 7.13 for link id 925
Updating rating to 9.11 for link id 993
Updating rating to 7.14 for link id 1154
Updating rating to 7.75 for link id 1265
Updating rating to 7.00 for link id 1279
Updating rating to 6.67 for link id 1287
Updating rating to 7.65 for link id 1283
Updating rating to 4.00 for link id 1341

CGI ERROR
==========================================
Error Message : fatal error: Illegal division by zero at /usr/www/tententh/httpd/htdocs/links/admin/nph-build.cgi line 457, chunk 1115.

Script Location : /usr/www/tententh/httpd/htdocs/links/admin/nph-build.cgi
Perl Version : 5.00502

Form Variables
-------------------------------------------

Environment Variables
-------------------------------------------
AUTH_TYPE : Basic
DOCUMENT_ROOT : /usr/www/tententh/httpd/htdocs
GATEWAY_INTERFACE : CGI/1.1
HTTP_ACCEPT : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
HTTP_ACCEPT_CHARSET : iso-8859-1,*,utf-8
HTTP_ACCEPT_ENCODING: gzip
HTTP_ACCEPT_LANGUAGE: en
HTTP_CONNECTION : Keep-Alive
HTTP_HOST : www.ten-tenths.com
HTTP_REFERER : http://www.ten-tenths.com/links/admin/admin.cgi?display=navigation
HTTP_USER_AGENT : Mozilla/4.08 [en] (Win95; I ;Nav)
PATH : /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/bin:/usr/X11R6/bin:/root/bin:/usr/local/Hughes/bin:/usr/www/virtualisys/httpd/htdocs/cuc hat/kaffe/bin:/usr/local/interviews/bin/FREEBSD
QUERY_STRING :
REMOTE_ADDR : 194.222.206.166
REMOTE_HOST : titangb.demon.co.uk
REMOTE_PORT : 1278
REMOTE_USER : Craig1
REQUEST_METHOD : GET
REQUEST_URI : /links/admin/nph-build.cgi
SCRIPT_FILENAME : /usr/www/tententh/httpd/htdocs/links/admin/nph-build.cgi
SCRIPT_NAME : /links/admin/nph-build.cgi
SERVER_ADMIN : webmaster@ten-tenths.com
SERVER_NAME : 216.55.29.184
SERVER_PORT : 80
SERVER_PROTOCOL : HTTP/1.0
SERVER_SOFTWARE : Apache/1.2.6


------------------
Craig Antill
10 Tenths Motorsport - www.Ten-Tenths.com/links/
Parc Ferme Magazine - www.Ten-Tenths.com/Parc_Ferme/
THE Directory - www.gardenbuildings.com/

Quote Reply
Re: Illegal division by zero at nph-build.cgi line 457, chunk 1115. In reply to
errrm.. somehow you are dividing the rating by votes.. and votes is zero... that doesn't make any sense at all.. Wink

if a link doesn't have any votes.. it should even go into that subroutine..

jerry
Quote Reply
Re: Illegal division by zero at nph-build.cgi line 457, chunk 1115. In reply to
OK, so why's it started ? And what do I do to fix it ?

Cheers!

------------------
Craig Antill
10 Tenths Motorsport - www.Ten-Tenths.com/links/
Parc Ferme Magazine - www.Ten-Tenths.com/Parc_Ferme/
THE Directory - www.gardenbuildings.com/

Quote Reply
Re: Illegal division by zero at nph-build.cgi line 457, chunk 1115. In reply to
Anyone ?!

------------------
Craig Antill
10 Tenths Motorsport - www.Ten-Tenths.com/links/
Parc Ferme Magazine - www.Ten-Tenths.com/Parc_Ferme/
THE Directory - www.gardenbuildings.com/

Quote Reply
Re: Illegal division by zero at nph-build.cgi line 457, chunk 1115. In reply to
woops.. i didn't come into links discussion yesterday.. i fell asleep right after school.. way too tired..

hmm.. anyways.. i don't know what to tell you.. something you might try is finding this line in sub update_ratings in nph-build.cgi

Code:
if (exists $votes{$id}) {

and changing it to

Code:
if (exists $votes{$id} && $votes{$id} > 0) {

but i still don't know why a 0 would have gotten in there with $votes{$id} not being 0! Smile

jerry
Quote Reply
Re: Illegal division by zero at nph-build.cgi line 457, chunk 1115. In reply to
Thanks Jerry,
I got it sorted out!

Our server crashed last weekend and it left several 0 byte files in the hits directory. Deleting these enabled the script to run without problems...

Cheers!

------------------
Craig Antill
10 Tenths Motorsport - www.Ten-Tenths.com/links/
Parc Ferme Magazine - www.Ten-Tenths.com/Parc_Ferme/
THE Directory - www.gardenbuildings.com/