Project

General

Profile

Random "500 Internal Server Error" with Perl

Added by polki almost 15 years ago

Hi guys,
got lighty running on Debian Lenny. Unfortunately i randomly get errors (500 Internal Server Error) with a perl script responding to an AJAX-request performed through a call from the PROTOTYPE javascript framework.
I can exclude an error within the script itself since it contains exactly two lines:
#!/usr/bin/perl
print "123test";
Bad thing is that it sometimes works and responds with the specified text to the ajax call, sometimes it doesn't, responding with the mentioned error.
Even worse, lighty doesn't show anything in it's error.log, access.log shows the accesses and that they sometimes end in status 200, sometimes in status 500...
In lighttpd.conf i got the following:
$HTTP["url"] =~ ".cgi" {
cgi.assign = ( ".cgi" => "/usr/bin/perl" )
}
Anybody got me some help?


Replies (3)

RE: Random "500 Internal Server Error" with Perl - Added by polki almost 15 years ago

Ok, did some more testing. This has got nothing to do with Perl in general. It also happens with scripts using PHP.
So the problem seems to be anything between the Prototype ajax request and the script that is called from this ajax request.
Some more testing revealed, that the script is called and fully executed though (making the perl script write something out to a file leads to this file being written like it should), still the ajax-request SOMETIMES and only SOMETIMES ends with a "500 Internal Server Error" message. The other times it works just fine...

RE: Random "500 Internal Server Error" with Perl - Added by polki almost 15 years ago

Come on guys, please help me with this problem. I've already been urged to switch to another webserver, but i want to get this running with lighty!

RE: RE: Random "500 Internal Server Error" with Perl - Added by Davide_Baldini about 10 years ago

Does your Perl script execute correctly up to its very last line, or have you just observed that it runs up to "some point" and outputs a file?
Is the script's exist status "0"?
Did moving to another webserver solve it?

I reported a similar problem as yours: Intermittent HTTP 500 on CGI

    (1-3/3)