Skip to main content

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

Set up:

  • Plesk Obsidian 18.0.28
  • Centos 7

Like any error that pops up, the real check is how do you react?

  • Keep and calm and investigate - even if colleagues are stressed out; 
  • Grab a stress ball and work on it hard; or
  • Join and stressed out party and lose perspective.

I haven't seen this one before.  A quick search through Google and I discovered a solution on Virtualmin.  However, they write about a migration process which for us wasn't happening.  Second, they point to a directory fcgi-bin.  A quick look using shell ls command and again not us.  But the essence of what they wrote about pointed me in the right direction.

In Plesk, I performed the following steps:

  • Respective domain.com;
  • Hosting settings; and
  • Then scrolled to the bottom and clicked Apply

Checked the front-end of the offending site, and back up and running.

 

Logs

Looking through the error logs on the server, not that much more was shown from the original error:

  • [Thu Aug 06 10:25:14 2020] [warn] [client xxx.xx.xx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
  • [Thu Aug 06 10:25:14 2020] [error] [client xxx.xx.xx.xxx] Premature end of script headers: index.php

So I needed to alter the mod_fcgi through using FcgidBusyTimeout.  This can be applied a couple of ways.

  1. Through Plesk:
    1. Respective domain.com;
    2. Click on PHP Settings;
    3. Scroll to the bottom and in the input box for Additional directives, add 
      1. FcgidBusyTimeout=3600
    4. Click Apply
  2. Using Shell:
    1. Open your directory of the domain 
    2. cd /var/www/vhosts/your-domain.com
    3. Open .htaccess file using
      1. vi .htaccess
    4. Add the following lines
      1. <IfModule mod_fcgid.c>
        FcgidBusyTimeout 3600
        </IfModule>
    5. Save [esc]wq!

With either, when you go back to the front end, potentially on your first refresh you might see 502 error.  No issue, refresh again and the error should be gone and your site back up.

Related articles

Andrew Fletcher06 Jun 2021
composer memory_limit
A recent attempt to run an update&nbsp;composer (regular activity for many of us), I had a memory limit issue. &nbsp;This was surprising because&nbsp;the memory setting via Plesk is set to 2G. &nbsp;Yet through Terminal&nbsp;it was showing only 128MB. &nbsp;What gives?? &nbsp; The error I was...
Andrew Fletcher02 May 2021
Installing Erlang XMPP on Apache
I'm writing these steps primarily for myself as a reference. &nbsp;However, if someone else finds them useful to great. Adding XMPP framework to your server. &nbsp;Initially I was going to add Prosody, however as I'm working off an Apache server with Centos 6.10 this quickly proved to a goal that...
Andrew Fletcher11 Mar 2021
Allegedly a server upgrade to CentOS 7
I had been running a few Centos 6 servers just past their EOL (30th November 2020) and it was time to kick in to action a plan I had been working on when I realised EOL was on my doorstep. A month or&nbsp;so beforehand, I started researching options to&nbsp;upgrade&nbsp;to Centos 7. &nbsp;Okay...