500 Internal Server Errors all of a sudden

fishfreek

Well-Known Member
Jan 2, 2004
238
0
166
I havent changed any settings on the server in a very long time. Today I get reports that some of the domains hosted on the server are now giving 500 errors when visiting. Indeed a domain that worked yesterday for me no longer comes up. All I get is the standard 500 error page.

The domain error log just reports "Premature end of script headers:" as the error. I don't understand why all of a sudden today out of the blue this would stop working.
 

arunsv84

Well-Known Member
Oct 20, 2008
372
1
68
127.0.0.1
cPanel Access Level
Root Administrator
1.Directory permissions: your cgi-bin directory should be chmodded as 0755

2.File permissions: your CGI script itself must also be 0755

3.Transfer modes:

If you are using FTP to transfer the CGI script to your server, then your FTP client is probably set to AUTO transfer mode. that is, it will try to figure out whether to use BINARY or ASCII mode without asking you. But depending on whether your CGI script came from a Windows or UNIX system, and whether it's going to a Windows or UNIX system, you may need to manually set your FTP client to use either ASCII or BINARY mode before transferring your CGI script.

4.Also make sure that the first line of a CGI script must contain the path to the Perl binary on the server.

5.In addition, a configuration problem in suEXEC, mod_perl, or another third party module can often interfere with the execution of your CGI and cause the "premature end of script headers" message.

Hope this helps... :)
 

thobarn

Well-Known Member
Apr 25, 2008
152
1
68
sanctum sanctorum
For what it is worth, I experienced this too. Suddenly most WHM functions were returning 500 Internal server error with "Premature end of script headers..." for most UI reachable functionality. Seems to be resolved now, though Perl seems to have regressed to an earlier version. I had to update manually.

I also received tye following email from cpaddons_report.pl

Code:
"Can't locate YAML/Syck.pm in @INC (@INC contains: /usr/local/cpanel /usr/local/cpanel/cpaddons /usr/local/cpanel /usr/local/cpanel/whostmgr/docroot/cgi /usr/local/cpanel/cpaddons /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.4/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.3/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.2/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.1/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.0/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.4/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.3/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.2/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.1/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.0/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at /usr/local/cpanel/Cpanel/DataStore.pm line 10.
BEGIN failed--compilation aborted at /usr/local/cpanel/Cpanel/DataStore.pm line 10.
Compilation failed in require at /usr/local/cpanel/Cpanel/cPAddons.pm line 11.
BEGIN failed--compilation aborted at /usr/local/cpanel/Cpanel/cPAddons.pm line 11.
Compilation failed in require at /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl line 10.
BEGIN failed--compilation aborted at /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl line 10."
 

Infopro

Well-Known Member
May 20, 2003
17,090
518
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
For what it is worth, I experienced this too. Suddenly most WHM functions were returning 500 Internal server error with "Premature end of script headers..." for most UI reachable functionality. Seems to be resolved now, though Perl seems to have regressed to an earlier version. I had to update manually.

I also received tye following email from cpaddons_report.pl

Code:
"Can't locate YAML/Syck.pm in @INC (@INC contains: /usr/local/cpanel /usr/local/cpanel/cpaddons /usr/local/cpanel /usr/local/cpanel/whostmgr/docroot/cgi /usr/local/cpanel/cpaddons /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.4/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.3/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.2/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.1/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.0/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.4/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.3/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.2/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.1/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.0/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at /usr/local/cpanel/Cpanel/DataStore.pm line 10.
BEGIN failed--compilation aborted at /usr/local/cpanel/Cpanel/DataStore.pm line 10.
Compilation failed in require at /usr/local/cpanel/Cpanel/cPAddons.pm line 11.
BEGIN failed--compilation aborted at /usr/local/cpanel/Cpanel/cPAddons.pm line 11.
Compilation failed in require at /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl line 10.
BEGIN failed--compilation aborted at /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl line 10."
Please see this upgrade checklist.

http://forums.cpanel.net/showthread.php?t=66166&highlight=upgrade+checklist

The newest cPanel needs Perl 5.8.8 anything older than that, YMMV.
 

thobarn

Well-Known Member
Apr 25, 2008
152
1
68
sanctum sanctorum
The thing is, I have been running cPanel 11.24.4-S33345 for a while now with no problem. Updates are set to manual and I did not update anything or made any configuration changes.

500 errors just happened for a period of a couple of hours yesterday, then stopped happening by itself. At this point Perl was still not 5.8.8.

A while later I received the email, which may or may not be related to the 500 incidents at which point updated to 5.8.8, but by that time 500 errors were gone anyways.
 

scottc

Well-Known Member
Apr 21, 2002
49
0
306
This started a few minutes ago on a cPanel 11.24.4-C34960. Perl is v5.8.8. As far as I know nothing changed on the server.
 

BubbaGum

Active Member
Nov 10, 2004
36
0
156
Western US
I've been fighting this snce yesterday. anyone have a solution?

iver tried reinstalling perl (it was 5.8.8 prior) from thread:
http://forums.cpanel.net/showthread.php?t=112633

i've tried the yum updates at same thread.

done the services restarts, server reboots, etc.

I turned off suexec and that worked for simple scripts as long as you chmod dirs to 0755. but agoracart will not work because it needs the suexec enabled.

we have current release and centos 4.7. It hit us without any intervention on our behalf as well so it had to be an auto update somewhere, possibly centos. Cannot find any resolution elsewhere, so wondering if possible to rool back centos or if there is something else that th cpanel community is aware of that might work as our servers are now useless for cgi and cpanel (perl)


UPDATE:

SOLVED!!!!

for our problem, it seems the /usr/local/apache/logs/suexec_log hit 2G in size renaming solved the problem. There is a 2GB limit on the file and this was a long running server. So check the size of your logs if other things do not seem to work (or check them first). kudos to cpanel support staff (Ken F) for seeing this problem in mere minutes.
 
Last edited:

PbG

Well-Known Member
Mar 11, 2003
246
0
166
Thanks. This was the problem here too.

UPDATE:

SOLVED!!!!

for our problem, it seems the /usr/local/apache/logs/suexec_log hit 2G in size renaming solved the problem. There is a 2GB limit on the file and this was a long running server. So check the size of your logs if other things do not seem to work (or check them first). kudos to cpanel support staff (Ken F) for seeing this problem in mere minutes.