Forum Moderators: coopster & phranque

Message Too Old, No Replies

CGI / HTTP header problems

"uncle"

         

txbakers

8:53 pm on Jan 29, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm stumped. I'm not too familiar with the inner workings of CGI so I'm writing for help.

Last night the CGI (perl) scripts didn't work. The error was: The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: (nothing else)

Everything looked fine onthe server. I reinstalled Perl anyway.

The scripts started working.

Today again I get the same error.

What does this error mean? And how can I fix it? If it's more complicated than I think, please sticky.

Thanks all.
Mike

littleman

9:50 pm on Jan 29, 2002 (gmt 0)



What type of script is it? What does it do? Can you run other scripts? What type of server are you running?

Try running the script via command line and see what happens. We just need more info to do a good job analyzing what's happening.

txbakers

11:03 pm on Jan 29, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Littleman:

The main script is a guestbook script. I just tried another perl script and that returned the same error.

When I called the script from the command line I was able to see the resultant HTML code.

I'm running IIS5.0 on W 2000.

Perl is new. Last night I did a "repair", tonight I"ll try an uninstall/reinstall of the Perl.

Two days ago a client reported this same error. When I checked it, it was working. Later that day the error returned. Last night I did the "repair" and it was working. This morning the same error returned.

I also have a form-mail script. That is not working as well - same error.

The Path to Perl is correct. I checked the ASP extensions and the PERL server variables are in the correct place.

Thanks for your help!

Mike

Damian

7:23 am on Jan 30, 2002 (gmt 0)

10+ Year Member



A long shot, but maybe you should check your logs:
I once had a very erratic problem with all our cgi's. They worked one moment and not the next, only to be back an hour later. It turned out to be caused by large (binary) logs which could still be parsed if the server wasn't to busy, but the cgi's choked when it got just a little busier.
The error (I run apache) was always ' premature end of script headers' which put me on the wrong track at first.

txbakers

11:59 am on Jan 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks D.

Silly question, what can I do about this? Not keep logs?

I reinstalled Perl, and also stopped and started IIS. That seemed to get it working again, but I haven't checked from outside the firewall this morning.

Damian

12:40 pm on Jan 30, 2002 (gmt 0)

10+ Year Member



You can keep logs of course, what I meant is the logs can't grow indefinitly if you use scripts that need to parse them. Depending on your script this may even happen if you are just writing to a log, but checking consistency of the log first.
Sorry, can't help you with IIS syntax or paths, but basically I suggest you clear your logs and see if that helps.
If it does, just clear the logs in the future before they get to whatever size they are now.

txbakers

5:20 pm on Jan 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't think it's a logs problem either. About a week ago I did a clean install of W2000, so all the log files were deleted and started a fresh.

this morning it was working, now it is not again. Same error.

ARGGGH! Computers......

Brett_Tabke

7:20 pm on Jan 30, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Try adding this as the second line of your perl script:

useCGI::Carp qw (fatalsToBrowser);

That will kick any fatal errors to the browser.

More than likely you have something that is getting executed before the script sends out the content type. When that occurs, the webserver doesn't know what content it is dealing with and errors. That could be happening for quite a few reasons, but probably there is something different that is occuring between the various runs of the script to cause it to error.

txbakers

10:04 pm on Jan 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks, Will Do!

txbakers

4:39 am on Jan 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Still Stumped. I added the code, and the pages worked.

Three hours later - same error with nothing written to the browser. I've used that line of code in other PERL scripts so I do know when it works.

And it's every perl script on the server.

What about Norton? Could that be interfering with scripts? I know they have a script blocking part of their virus protection. I can't recall where to disable it.

txbakers

5:29 am on Jan 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm still crying uncle - not 1 hour after I made the last post I checked the site again and the CGI scripts are working again.

VOODOO???????

Brett, what would cause them to come in and out like that? I'm going to check Norton and see what happens.

I put the URL in my profile if anyone is brave enough to check it.

edit: And now it's out again.
This is baffling.

Brett_Tabke

9:32 pm on Jan 31, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



That sounds like a system problem tx. I wouldn't know where to start trouble shooting that from here.

I'd really harass the host for error logs.

If it is just one script, then I'd think it is the script; but, if it is all perl scripts, then I'd look to the system as the source of the problem.

txbakers

10:06 pm on Jan 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm the host....... Should I check event logs? or the HTTP logs?