I am running php-fpm.x86_64 - 5.6.30-1.el7.remi

It appears php-fpm is causing a 503 service unavailable error on certain Drupal scripts (in this case taxonomy add vocabulary) and produces => AH01067: Failed to read FastCGI header - according to the log

This seems to be common - but I have not found a common path to fix it. I am running 2.4.25 Apache from Codeit with php 5.6.30 from remi

I have another CentOS 7 server - same Apache set up - NOT running php-fpm and it works fine on the same command which fails on the php-fpm system.

Otherwise they are identical

Some people find the error is related to opcache. and the answer is to - increase opcache.max_accelerated_files from default 4000 to about 16000. I do not believe i am running opcache (Zend engine opcache in phpinfo)

The other suggestion is to increase ProxyTimeout to a large number like 600 seconds - 10 minutes

Percona says increase the max_execution_time of php in the ini to a high number and connect_timeout in the my.cnf accordingly with plenty of execution memory available

The issue is clearly php-fpm as the other identical server on the plain (and slow) Apache 2.0 handler works

Does anyone know if there is a KNOWN FIX parameter to adjust to solve this in the php-fpm *.conf pool files in /etc/php-fpm.d OR httpd.conf ??

OR - HOW this is solved on Centos 7 set up of php-fpm on php-fpm.x86_64 - 5.6.30-1.el7.remi which what I have installed ( and php70-php-fpm.x86_64 - 7.0.17-1.el7.remi - BUT I am not using that one)

Apparently php-fpm has a 30 second hard-coded timeout - which was fixed in Apache 2.4.6.34 (red hat numbering) to honor the Proxy timeout directive. See https://bugzilla.redhat.com/show_bug.cgi?id=1222328 [2.4.6.34 Red Hat "httpd" server is around 2.4.20 Apache]

I used it as

# Proxy declaration

# we must declare a parameter in here (doesn't matter which) or it'll not register the proxy ahead of time
ProxySet disablereuse=off
ProxySet timeout=300

# Redirect to the proxy

SetHandler "proxy:unix:/run/php-fpm/xxxxxxxxxxxxxxxx.com.sock|fcgi://localhost"

in the httpd.conf - which works as to recognizing the timeout as set - but taxonomy/add fails and makes the database unusable - the site will not answer - but hangs at "waiting" - and mysql must be restarted, the database dropped and a backup copied back to the working database name to get the site to answer - thus any dblog entry is lost also

**** [proxy_fcgi:error] [pid 2154] . . . AH01067: Failed to read FastCGI header, referer: https://xxxx.com/admin/structure/taxonomy/add
**** [proxy_fcgi:error] [pid 2154] (104)Connection reset by peer: AH01075: Error dispatching request to : , referer: https://xxxx.com/admin/structure/taxonomy/add
**** [proxy_fcgi:error] [pid 2058] AH01067: Failed to read FastCGI header, referer: https://xxxx.com/admin/structure/taxonomy/add
**** [proxy_fcgi:error] [pid 2058] (104)Connection reset by peer: AH01075: Error dispatching request to : , referer: https://xxxx.com/admin/structure/taxonomy/add
**** [proxy_fcgi:error] [pid 2396] (70007)The timeout specified has expired: AH01075: Error dispatching request to : (polling), referer: https://xxxx.com/admin/structure/taxonomy
**** [proxy_fcgi:error] [pid 2022] AH01067: Failed to read FastCGI header, referer: https://xxxx.com/admin/reports/dblog
**** [proxy_fcgi:error] [pid 2022] (104)Connection reset by peer: AH01075: Error dispatching request to : , referer: https://xxxx.com/admin/reports/dblog
**** [proxy_fcgi:error] [pid 2414] (70007)The timeout specified has expired: AH01075: Error dispatching request to : (polling)

excerpt above from /var/log/php-fpm/error.log

Has anyone seen this or is there a known cure ??

Comments

bobburns created an issue. See original summary.

joep.hendrix’s picture

For what it is worth, I have noticed the same problem on a production site.
Ending up with disabling opcache. I am not sure it is related to taxonomy though.

bobburns’s picture

I did discover the ProxySet statement should all be on one line in the httpd.conf as thus

# Proxy declaration

# we must declare a parameter in here (doesn't matter which) or it'll not register the proxy ahead of time
    ProxySet keepalive=On connectiontimeout=5 timeout=600 disablereuse=off

# Redirect to the proxy

SetHandler "proxy:unix:/run/php-fpm/xxxxxxxxxxxxxxxx.com.sock|fcgi://localhost"

in the httpd.conf - which works as to recognizing the timeout and other variables as set

But it fixed other timeout issues - but still I cannot create any new vocabulary

I have noticed now timeouts do not trash the database - and at some times if I click the button AGAIN while processing - it may complete - but still I have had no success at all with creating a new vocabulary

Yes this is a production site - so I am beginning to believe there is also an "internet issue" with routing and timing - possibly to the browser so I will investigate other browsers next to see if all of them do the same thing

Version: 7.54 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.