Gossamer Forum
Home : Products : DBMan : Installation :

Sudden Error

Quote Reply
Sudden Error
HI, all.

I had the dbMan script working just fine, but two days ago something went wrong. I hadn't made any changes recently, but the Add Record function has stopped working. Everything else works fine, but Add Record produces and internal error, but it won't tel me exactly what the error is. Here's what it DOES tell me.

DBMan encountered an internal error.

CGI ERROR
==========================================
Error Message : Debug Information
Script Location : /home/rapier/html/scripts/dbman/db.cgi
Perl Version : 5.006
Setup File : default.cfg
User ID : webmaster
Session ID : webmaster.101806047437266

Form Variables
-------------------------------------------
ID : 51
add_record : Add Record
db : default
email : eru@jrhgr.com
location : lurehgoiuresg
position : eurhguirereh
rank : dlkjshfa
scaname : iurrierbui
uid : webmaster.101806047437266

Environment Variables
-------------------------------------------
CONTENT_LENGTH : 160
CONTENT_TYPE : application/x-www-form-urlencoded
DOCUMENT_ROOT : /home/rapier/html
GATEWAY_INTERFACE : CGI/1.1
HTTP_ACCEPT : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, */*
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_CONNECTION : keep-alive
HTTP_HOST : rapier.atlantia.org
HTTP_REFERER : http://rapier.atlantia.org/scripts/dbman/db.cgi?db=default&uid=webmaster.101806047437266&add_form=1
HTTP_USER_AGENT : Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
HTTP_VIA : 1.1 maincache
HTTP_X_FORWARDED_FOR: 209.192.109.152
PATH : /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
QUERY_STRING :
REMOTE_ADDR : 209.192.106.132
REMOTE_PORT : 54931
REQUEST_METHOD : POST
REQUEST_URI : /scripts/dbman/db.cgi
SCRIPT_FILENAME : /home/rapier/html/scripts/dbman/db.cgi
SCRIPT_NAME : /scripts/dbman/db.cgi
SERVER_ADDR : 208.223.136.12
SERVER_ADMIN : webminister@atlantia.sca.org
SERVER_NAME : trident.atlantia.sca.org
SERVER_PORT : 80
SERVER_PROTOCOL : HTTP/1.1
SERVER_SIGNATURE : Apache/1.3.20 Server at trident.atlantia.sca.org Port 80

SERVER_SOFTWARE : Apache/1.3.20 (Unix) (Red-Hat/Linux) mod_ssl/2.8.5 OpenSSL/0.9.6b DAV/1.0.2 PHP/4.0.6 mod_perl/1.24_01

What I see when I look at this is that it's trying to make a record with ID# 51. The problem is, there's already a record 51. It's a bit frustrating, because it was working fine for a while, and we were adding records as necessary, then this came up.

Then again, I could be way off, and it may be some other problem entirely.

The script is set to track the ID#. Any idea what I can do about this?

Eric
Quote Reply
Re: [aodhfionn] Sudden Error In reply to
Looks just like debugging info. Make sure debugging is off.
Quote Reply
Re: [aodhfionn] Sudden Error In reply to
You might want to try the following and see if it will solve your problem. I use these changes to prevent a new ID number from being assigned when the page reloads, but I think it will help with your problem also.

In your .db.cgi file sub add_record

try commenting out the following lines:

#### removed to prevent a new ID number from being assigned when the form is reloaded ######
## We keep checking for the next available key, or until we've tried 50 times after which we give up.
# while ($status eq "duplicate key error" and $db_key_track) {
# return "duplicate key error" if ($counter++ > 50);
# $in{$db_key}++;
# $status = &validate_record;
# }

Then in your html.pl file in sub html_add_failure

after: my ($message) = $_[0];

Add:

### add to prevent dup ID numbers also commented out code in .cgi sub add_record #####
if ($message eq "duplicate key error") {
&html_home;
return;
}
### end of change ####

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Sudden Error In reply to
I tried the comment suggestion, and it still didn't work. So I tried an experiment, by opening the database file and adding an entry that way. That worked fine, so I tried to delete it by way of the delete command in the script, with exactly the same result as I had been getting with the add attempts. So it seems that the script has decided to stop writing to the database file. I haven't changed anything since I got it working, so I have no idea where to even begin looking.

If anyone wants to take a crack at this, I'll happily post or give access to whatever you need.

Thanks,
Eric
Quote Reply
Re: [aodhfionn] Sudden Error In reply to
This error maybe caused by the duplicated id. Can you edit the default.count to increase the value in it?

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [aodhfionn] Sudden Error In reply to
Check the permissions for your .count and .db files. You might also want to bring your database into excel and check that all the fields are entered correctly where they should be. You could tell by viewing every record also.

Sometimes the database gets corrupted for various reasons such as placing weird characters, etc.

If you want your files viewed it's best to make a .txt copy of your .cfg, .db, html.pl and db.cgi files, and posting the url to where they can be viewed.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [tandat] Sudden Error In reply to
I tired editing the default.count file as you suggested. That didn't work either. So what I wound up doing is just getting rid of the numerical key, and used another field as the key (being careful to choose one where each entry would be unique.) Then I told it not to track the key, and it seems to be working fine now.