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.