Gossamer Forum
Home : Products : DBMan : Customization :

Sorting causes internal server error "Premature end of script headers"

Quote Reply
Sorting causes internal server error "Premature end of script headers"
Hi,

I have a dbman database running quite happily on a unix server, but I have one problem. When a search returns a large set of records (over 4000) AND the user has chosen to sort them, I get the error message above. I don't get the error if the search returns a smaller set of records. I don't get the error if I do "list all" without sorting, or for any other search.

Has anybody come across this before, or can anybody offer any suggestions?


http://www.classicalvinylrecords.co.uk/cgi-bin/record.cgi?db=record&uid=default&view_search_quick=1

Try "Browse all records" to see the problem - there's a sort built in here.

Many thanks
Tim Ault
Oxford UK
Quote Reply
Re: [timbo] Sorting causes internal server error "Premature end of script headers" In reply to
For several of the search forms you you haven't defined the form action with the name of your db.cgi filename.

<form action="" method="GET" name="form1">
<input type=hidden name="db" value="record">
<input type=hidden name="sb" value="5">

For the browse dealers you have included the db name within the form action. It should be just:

<form action="dealer.cgi" method="GET" name="form1">
<input type=hidden name="db" value="dealer">

Perhaps fixing those lines will help solve the search error messages.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Sorting causes internal server error "Premature end of script headers" In reply to
Lois,

Thanks for taking the time to look at this. The form action was incorrect and I have now corrected it. But the problem remains.

If you do a list all, 4917 records are listed:
http://www.classicalvinylrecords.co.uk/cgi-bin/record.cgi?db=record&uid=default&view_records=1&ID=*

If you add a sort, you get an error
http://www.classicalvinylrecords.co.uk/cgi-bin/record.cgi?db=record&uid=default&view_records=1&ID=*&sb=5

If you do a search which returns a smaller set of records, all is well, even with the sort:
http://www.classicalvinylrecords.co.uk/cgi-bin/record.cgi?db=record&uid=default&view_records=1&Label=Decca&sb=5

I'm wondering if the web server might be running out of memory on the sort. Is that possible?
Tim Ault
Oxford UK
Quote Reply
Re: [timbo] Sorting causes internal server error "Premature end of script headers" In reply to
It's a "500" error, I was expecting a 5000 error (if I'm not mistaken). It could be a memory problem. I started putting in a parameter for max hits (thinking it'd show more records per page, but it didn't) and got the error message when adding mh=5000 to the end of your URL, if I dropped it down to 1000 I didn't get an error. It occured somewhere between 3000 and 4000 records.

Not too sure if this is relevant, sorry I couldn't be of more help.
Quote Reply
Re: [Watts] Sorting causes internal server error "Premature end of script headers" In reply to
I think Watts is correct as it having to do with either memory or a server timeout.

I've had similiar problems with the sort of large database as think that the server I used this on would timeout the script if it ran for more than a certain number of seconds, such as with large search results.

I've noticed this with using the Top 10 mod and certain searches on the same server. I never did track down exactly why with some databases I had problems when using the sort order, but I think now it's probably related to the size of the returned records and a memory or timeout issue.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [Watts] Sorting causes internal server error "Premature end of script headers" In reply to
Watts - What did you add to the end of my url, please?

I will ask the server people if the script might be timing out / running out of memory.
Tim Ault
Oxford UK

Last edited by:

timbo: Nov 11, 2002, 10:59 PM
Quote Reply
Re: [timbo] Sorting causes internal server error "Premature end of script headers" In reply to
I don't like answering for others, but Watts stated that he added:

&mh=5000

to the end of your url, and then played around with different number of records in place of the 5000.

If I'm not correct hopefully Watts will also respond :)

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Sorting causes internal server error "Premature end of script headers" In reply to
Just to round off this topic: I did talk to the server people and they agreed that the script was timing out, but they weren't able to do anything to help. Moving the site elsewhere solved the problem.
Tim Ault
Oxford UK