Forums / General Questions / 500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

Views: 75,296

Results 1 to 15 of 15
15 Oct 2008, 10:10 AM
#1
dave_t avatar

dave_t

New Zenner

Join Date:
Nov 2007
Posts:
4
Plugin Contributions:
0

500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

Hello,

Thanks in advance for any help. On occasion when entering Admin, and sometimes during the customer checkout process, a "500 Internal Server Error" page will be returned. I found a correlation to these errors in the Apache error log. The error is as follows:

[Wed Oct 15 01:53:37 2008] [error] [client xx.xx.xx.xxx] FastCGI: incomplete headers (0 bytes) received from server "/home/content/....omitted.../html-x-httpd-php"

I am unable to access mySQL logs to look for correlated entries.

Anyone have a clue? Thanks!

3 Nov 2008, 12:21 AM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: 500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

I recommend reviewing this thread.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

1 Dec 2008, 3:11 AM
#3
talk2kmf avatar

talk2kmf

New Zenner

Join Date:
Mar 2008
Posts:
18
Plugin Contributions:
0

Re: 500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

I am getting this 500 Internal Server error also, very sporadically when either deleting an item from the shopping cart, updating quantities, clicking on the Checkout button, or later changing the address in the Checkout page. The error typically happens about 20-30 minutes after I start testing the shopping cart and shipping options but that could just be coincidental.

The log shows the same error:

FastCGI: incomplete headers (0 bytes) received from server "/var/chroot/home/content/<myusrdirectory>/html-x-httpd-php"

I've been using a sub-domain for zencart, with the correct configurations in the config file. As far as I can tell the permissions are set correctly (although I don't have shell access).

Functionally, everything else seems to work fine. Also, when the error does occur, reloading the page continues the operation fine (for another 20-30 minutes of testing).

One final note, in order to show a customized "Please reload this page" message I created a webpage called "error500.shtml" and put it in the zencart root directory. I then added a .htaccess file to the zencart root directory with the following line:

ErrorDocument 500 /error500.shtml

At least now if a customer gets this error they will get a friendly request to just reload the page. But ideally I'd like to get the error fixed.

Any suggestions would be appreciated. Thanks!

KMF

1 Dec 2008, 10:11 AM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: 500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

The tip for creating a custom error 500 page is very helpful.

As to the error itself, this doesn't sound like it's anything to do with how you have Zen Cart configured. The error message is coming straight from your server (not the PHP parser which is where Zen Cart errors tend to be picked up) and suggests a more fundamental problem with how PHP itself is configured or your server's ability to handle it without timing out.

There are a few folks in the community who know a lot about hosting and servers and hopefully one of them will happen by with some insight, but the first port of call really needs to be your web host.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

1 Dec 2008, 11:08 AM
#5
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: 500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

In these type situations it's always best to clarify if things were working OK and, either a change was made or no change was made, before the problem started. Many times we makes changes; add a Mod, change paths in the config files, etc. and think nothing of it. There are also times when the Hoster will make changes and not notify Clients; which is very common because usually they do not need notice.

The cause of this particular problem is directly related to FastCGI and how it is setup on the Server. Could be anything from session/cache control; yours or the Servers, mySQL, corrupt file, and so.

This 'quicky' may or may not help.

Add this line to the top of your main .htaccess file.
AddHandler fastcgi-script .fcgi

Otherwise, best to contact your Hoster as only they can help sort out this type of problem.

The learning is in the doing.

Potent Products

3 Dec 2008, 2:15 AM
#6
talk2kmf avatar

talk2kmf

New Zenner

Join Date:
Mar 2008
Posts:
18
Plugin Contributions:
0

Re: 500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

Thanks for the suggestions. I tried adding the AddHandler line to .htaccess but the error appeared almost immediately.

I had not noticed this error until I started testing the shipping modules. I cloned a few and installed the Staticlist mod. I think the error appeared before I installed the mod but I don't recall.

Over the past few days the error occurred when I was testing the shipping and checkout but today it happened when I tried to log in, so it may not be specific to shopping cart processing.

Unfortunately, we're hosted on GoDaddy and their support is useless.
For example, I asked about creating a custom 500 error page and they told me it wasn't possible. Fortunately I found this page:
http://www.codestyle.org/sitemanager/apache/errors-500.shtml#apache-config

When I asked for help with this FastCGI error, they said I can either use their own webcart product or buy a dedicated server account. They refuse to admit it could be anything their server is doing and blame Zen Cart coding.

KMF

3 Dec 2008, 5:19 AM
#7
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: 500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

Time to shop around for a new Host as it seems GoDaddy cannot or will not fix your problems... which they seemed to have created.

The learning is in the doing.

Potent Products

3 Dec 2008, 7:04 AM
#8
talk2kmf avatar

talk2kmf

New Zenner

Join Date:
Mar 2008
Posts:
18
Plugin Contributions:
0

Re: 500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

I did manage to find a work-around, for now. I edited the error page to say "System Processing..." and then reload the page automatically by using a meta refresh=5 seconds tag. Here's what my error500.shtml has in it:

<html>
<head>
<meta http-equiv="refresh" content="5">
<title>System Processing 500</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p><center><H2>The system is processing your request. 
Please wait...</H2><p>If this message lasts for more than 30
seconds, please click the back button on your browser and try
again.</center>
</body>
</html>

Since the browser doesn't "see" the error page thrown up by the server it reloads the page it was supposed to bring up in the first place. I've tested it in Firefox 3 and Explorer 6 and it seems to work.

Note the .htaccess file is in the zencart sub-directory but the error page specified in the .htaccess file as " /error500.shtml " has to be in the system root directory. Otherwise you'll get a 404 at the end of the Internal Server Error message.

KMF

3 Dec 2008, 7:08 AM
#9
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: 500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

The main point is: the 500 error is unacceptable, it interferes with your customers shopping experience. Rewording the error message doesnt solve the problem.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

3 Dec 2008, 8:09 AM
#10
talk2kmf avatar

talk2kmf

New Zenner

Join Date:
Mar 2008
Posts:
18
Plugin Contributions:
0

Re: 500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

This might be another clue. Along with the error:

FastCGI: incomplete headers (0 bytes) received from server "/var/chroot/home/content/<myusrdirectory>/html-x-httpd-php"

I've now also got:

FONT="Courier New"Connection reset by peer: FastCGI: comm with server "/var/chroot/home/content/<myusrdirectory>/html-x-httpd-php" aborted: read failed[/FONT]

In addition, I'm noticing the error more often with Internet Explorer (~ every 10min) than with Firefox (~ 20-30minutes). The main difference I've seen between the two is that IE is faster loading pages. My guess is that IE maybe using more cache or it may process more quickly on the client side and is running into whatever is on the server causing the error more often than Firefox.

Any more debugging suggestions would be appreciated. Thanks!

KMF

3 Dec 2008, 8:19 AM
#11
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: 500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

It is possible that it has something to do with your cache.

Did you check the path to your cache folder in configure.php to see if it is correct? Check if the cache folder is writable.
Are you using db or file cache method? If you are using db cache, is the cache key fix utility from the addon section to correct any possible error.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

5 Dec 2008, 4:44 PM
#12
talk2kmf avatar

talk2kmf

New Zenner

Join Date:
Mar 2008
Posts:
18
Plugin Contributions:
0

Re: 500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

I had cache set to 'none'. I changed it to 'file' but there was no difference. The system wrote to the file fine so I don't think there are any permission issues.

I did find a blog post that mentions:

"Unfortunately, GoDaddy has the tendency to kill fcgi processes after about 5 minutes, and you might get the occasional error or the speed reduction at this time."

I also found similar complaints about other web hosts, so changing providers may not solve the problem.

KMF

7 Jan 2010, 6:56 PM
#13
jordxn avatar

jordxn

New Zenner

Join Date:
Jan 2010
Posts:
1
Plugin Contributions:
0

Re: 500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

I was having the same problem with GoDaddy hosting and found what seems to be the best solution for this problem on this blog - basically directly from godaddy tech support;


I would suggest changing the php to not use fastcgi. You can do this by going into the hosting control center and clicking settings then from the drop down menu select file extensions. Once the page load click edit next to .php on list and then from the drop down box choose PHP 5.x. This should resolve the issue and prevent it from occurring again.

This seem to fix the issue for me so defiantly worth a shot if your not using PERL or Ruby on Rails.

23 Dec 2010, 3:22 PM
#14
didolim avatar

didolim

New Zenner

Join Date:
Aug 2009
Posts:
16
Plugin Contributions:
0

Re: 500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

I have the same related 500 internal server errors.

the related errors in the apache error log are:
[10:15:48 AM] octo: [Sun Dec 19 18:18:50 2010] [warn] [client 207.46..] mod_fcgid: read data timeout in 120 seconds
[Sun Dec 19 18:18:50 2010] [error] [client 207.46..] Premature end of script headers: index.php
[10:16:39 AM] octo: also [warn] [client 66.249..] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server

Also I am hosted at godaddy. Of course godaddy told me that it was a scripting error. yeah yeah, we know by now their first response.
After pushing them they told me this answer:
After further review of your account it appears that the error logs are due to your scripts are causing the peer to reset. To protect the overall health and prevent your site for possibly over utilizing resources. Unfortunately on a shared environment we cannot allow scripts to run endlessly, and this seems to be where these errors are being produced. I recommend optimizing your site in such a fashion that your scripts are able to run on a shared hosting account. We appreciate your patience and understanding in this matter while we further investigated this for you.

OK. So Godaddy lets the apache server kill the fastCGI process after a few minutes. At that moment you will receive the 500 internal server error because the server can not serve the fastCGI process.

my zen cart has the following plugins installed:
image handler
lightbox
and SEO urls.

Is there anything I can do to solve this. I know the best thing is to move to another hosting provider but godaddy tricked me into prepaying their hosting for 5 years!!! So I really would prefer to make a workaround.
My site has an average of 10 concurrent site visitors per moment, so that is not so much.
please help, this will affect a lot of zen cart users hosted at godaddy. Needless to say that I feel tricked by godaddy with their unlimited crap hosting.

2 Jan 2011, 10:13 PM
#15
didolim avatar

didolim

New Zenner

Join Date:
Aug 2009
Posts:
16
Plugin Contributions:
0

Re: 500 Internal Server Error- FastCGI: incomplete headers (0 bytes) received from server

I decided to move to Terranetwork.net

AND WOW, what a difference.
what a service, they transfered my website for free and configured it for me. They had a lot of problems moving the website away from godaddy because of slow godaddy servers and 500 internal errors.

I wish I had left godaddy sooner. Godaddy is really the worst of all hosting providers. They were blaming me and zen cart for the 500 internal server errors and slow loading website, they were very wrong. Godaddy have a scam hosting!