Connection reset by peer: mod_fcgid: error reading data from FastCGI server

7 posts / 0 new
Last post
#1 Fri, 11/07/2014 - 03:44
paulocoghi

Connection reset by peer: mod_fcgid: error reading data from FastCGI server

After a migration (a full server clone) I started to receive Internal Server Error in PHP pages and in apache log:

[Fri Nov 07 04:39:59 2014] [error] [client 177.101.xxx.xxx] Premature end of script headers: index.php, referer: https://www.google.com.br/ [Fri Nov 07 04:40:00 2014] [warn] [client 177.101.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server [Fri Nov 07 04:40:00 2014] [error] [client 177.101.xxx.xxx] Premature end of script headers: index.php

Has anyone ever experienced this?

Tue, 12/23/2014 - 14:29
truthonlytruth11

I have exactly same problem

[Tue Dec 23 06:16:53 2014] [warn] [client ] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: http://www.domain.com/admin/languages/comparison/ [Tue Dec 23 06:16:53 2014] [error] [client ] Premature end of script headers: index.php, referer: http://www.domain.com/admin/languages/comparison/

I have applied this fixes: https://www.virtualmin.com/node/34903 http://stackoverflow.com/questions/12153518/connection-reset-by-peer-mod...

But still getting the above error message? What should I do?

Tue, 12/23/2014 - 16:26
andreychek

Howdy,

What if you switch the PHP Execution Mode to "CGI", does that produce a better error message?

You can change that by going into Server Configuration -> Website Options.

-Eric

Sat, 02/14/2015 - 14:45
PaulVM

Any update on this problem?

Same problem here. Tried in various combiantions. I cloned some OpenVZ container (VM Centos 7.0, Host Proxmox). All work fine except vhost that use CGI/FastCGI. If switch to mod_php works. Pretty sure no permission problem (I cloned the full VM) Tried various hints found in form and in the net for similar problem without results. Below rows in error log.

Thanks, P.

[Sat Feb 14 21:26:25.208129 2015] [cgi:error] [pid 1963] [client 10.20.30.81:50018] End of script output before headers: php5.cgi [Sat Feb 14 21:26:26.388160 2015] [cgi:error] [pid 1963] [client 10.20.30.81:51266] End of script output before headers: php5.cgi [Sat Feb 14 21:32:22.221231 2015] [fcgid:warn] [pid 2374] (104)Connection reset by peer: [client 10.20.30.81:48014] mod_fcgid: error reading data from FastCGI server [Sat Feb 14 21:32:22.221272 2015] [core:error] [pid 2374] [client 10.20.30.81:48014] End of script output before headers: t2.php

Sat, 02/14/2015 - 19:37
EcchiOli

I'm asking just in case, to clear away possible doubts, you moved your website to a different server, right ?

Did you check if your server's various essential configuration files (mysql's my.cnf, php's php.ini, apache's apache2.conf, mostly), to see if you don't have a bottleneck at some point ?

There are utilities to quickly see if nothing is really bad, like apachebuddy, mysqltuner and tuning-primer, the ones I know of.

That's now old to me, 2 years old, but I remember moving to a new server and not noticing that for some reason there was a ridiculous bottleneck in total threads, and - once again, it's old, so I may very well be mistaken - I think it was generating this kind of error in the error log.

Sat, 02/14/2015 - 22:56 (Reply to #5)
PaulVM

I have various servers that use as "hypervisor" ProxMox.

In these servers I have some VMs (usually CentOS); My problems are related to OpenVZ VM (noticied a similar problem some months ago moving a KVM based VM (CentOS6.x or 5.x), that use as storage NFS, but not sure it is the same problem).

N.B.: same problem cloning the VM to the same server (hypervisor).

I had cloned CentOS VMs to other servers. They work fine. The only problem is related to vhost with PHP configured in CGI/FastCGI. They serve non php pages or contents and if I switch to mod_php they works fine also with .php pages.

No resources, selinux (disabled) or similar problems.

Usually this kind of problems are selinux related. But I disable it by default so ...

If I install a fresh VM with the same configuration on the same server, no problems at all.

So, it is something related to the cloning/migration process (tried rsync, tar, vzdunp/vzrestore and verified owner/permission).

Is there a way to debug the CGI/FastCGI activity?

Thanks, P.

Tue, 02/17/2015 - 11:06 (Reply to #6)
PaulVM

After many hours of research, I had found the solution for my problem. If anyone have the same problem, doing rpm -V httpd results a change of "capabilities" of the /usr/sbin/suexec (lost). Reinstalling the packages solve the problem.

Regards, P.

Topic locked