Gossamer Forum
Home : Products : Links 2.0 : Discussions :

fatal error: Illegal division by zero

Quote Reply
fatal error: Illegal division by zero
Hello-

I have recently been having problems with Links 2.0... I have added no new mods and have made no changes other than adding links. Now when I try to build, I get fatal error: Illegal division by zero at /mnt/web/guide/mcmcse/tech/links/cgibin/links/admin/nph-build.cgi line 464, chunk 201.

I also noticed that we are having a problem with the "Top Rated" page which is located at http://techtutorials.com/Ratings/. You can take a look and see what it is doing towards the bottom. Could this be related?

I tried running the build from telnet and it was unsuccessful also. While in telnet, I noticed that the ownership of files was different on some files in the backup directory. Some files were owned by jsprague and some by nobody. Some were 644 permissions and some were 664. Could there be anything to this?

The directory now contains 1,400 links. Do we need to upgrade?

Any help on getting this back up and running again would be much appreciated.

Thanks,

Jason




Quote Reply
Re: fatal error: Illegal division by zero In reply to
1) Did you remove or add any fields in your links.def?

2) Did you neglect to update your links.db after removing or adding fields in your links.def file?

If so, guess what? Your database (links.db) is corrupted and you need to first restore your links.def and links.db. Then add one or remove fields one at a time and then update the links.db file with the upgrade.pl file that is referenced in quite a few Threads in the Links 2.0 Customization Forum.

BTW: You cannot remove the following fields:

1) Hits
2) Ratings
3) Votes
4) isPopular
5) isNew

without hacking the nph-build.cgi to ignore these fields during the build process.

Regards,

Eliot Lee
Quote Reply
Re: fatal error: Illegal division by zero In reply to
Thanks for the response.

I haven't removed or added any fields in links.def. In fact, no changes have been made other than adding links via the admin script, but it does appear that the links.db is corrupt. I will try restoring from backup, although it was backed up very recently...

Guess I'll need to get the SQL version soon...

Quote Reply
Re: fatal error: Illegal division by zero In reply to
Not really...with only 1,400 records (depending on the size of your fields), that should be fine with Links 2.0. If you exceed 5,000 records and 1.0 MG size of the database file, then you should consider upgrading to Links SQL.

Also, make sure that you have flocking enabled...it could also be a problem with the database file not locking properly.

Regards,

Eliot Lee
Quote Reply
Re: fatal error: Illegal division by zero In reply to
Thanks sir-

I was able to fix the build problem by following instructions from a previous post of yours. I deleted all of the category IDs in the rates directory.

However, still having a problem with the ratings at http://techtutorials.com/Ratings/

Look towards the bottom and you will see the problem. Appreciate your help,

Thanks,

Jason

Quote Reply
Re: fatal error: Illegal division by zero In reply to
In Reply To:
I deleted all of the category IDs in the rates directory.
You mean Link IDs, right???

In Reply To:
However, still having a problem with the ratings at http://techtutorials.com/Ratings/

Look towards the bottom and you will see the problem.
I would also delete all the ID files in the hits directory. Then do the following:

1) Use Build Staggered.
2) Then use Build All.


Regards,

Eliot Lee
Quote Reply
Re: fatal error: Illegal division by zero In reply to
Sorry, I meant link IDs. I tried removing the the IDs in the Hits directory, but that didn't seem to help...

I figured out which link was causing the problem and then changed the number of votes from 11 to 12 and that seemed to clear up the problem...

Thanks,

Jason