Service Unavailable error with PHP-FPM

Nirjonadda

Well-Known Member
May 8, 2013
736
27
78
cPanel Access Level
Root Administrator
I am getting error after enabled PHP-FPM. Please let me know the fix.


Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello,

Could you let us know the output from /usr/local/apache/logs/error_log when this happens?

Thank you.
 

Nirjonadda

Well-Known Member
May 8, 2013
736
27
78
cPanel Access Level
Root Administrator
Hello,

Could you let us know the output from /usr/local/apache/logs/error_log when this happens?

Thank you.
/usr/local/apache/logs/error_log

Code:
[Sat Dec 17 01:16:10.153706 2016] [proxy:error] [pid 2991] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php71/root/usr/var/run/php-fpm/61d7d10ebd8abcb33d00b707c6391df70e9c0b80.sock (*) failed
[Sat Dec 17 01:16:10.153798 2016] [proxy_fcgi:error] [pid 2991] [client 14.170.123.28:64107] AH01079: failed to make connection to backend: httpd-UDS
[Sat Dec 17 01:16:11.887476 2016] [proxy:error] [pid 2840] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php71/root/usr/var/run/php-fpm/61d7d10ebd8abcb33d00b707c6391df70e9c0b80.sock (*) failed
[Sat Dec 17 01:16:11.887555 2016] [proxy_fcgi:error] [pid 2840] [client 163.172.66.79:21440] AH01079: failed to make connection to backend: httpd-UDS
[Sat Dec 17 01:16:12.282225 2016] [proxy:error] [pid 2853] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php71/root/usr/var/run/php-fpm/61d7d10ebd8abcb33d00b707c6391df70e9c0b80.sock (*) failed
[Sat Dec 17 01:16:12.282290 2016] [proxy_fcgi:error] [pid 2853] [client 14.170.123.28:64109] AH01079: failed to make connection to backend: httpd-UDS
[Sat Dec 17 01:16:13.394540 2016] [proxy:error] [pid 3158] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php71/root/usr/var/run/php-fpm/61d7d10ebd8abcb33d00b707c6391df70e9c0b80.sock (*) failed
[Sat Dec 17 01:16:13.394626 2016] [proxy_fcgi:error] [pid 3158] [client 14.170.123.28:64111] AH01079: failed to make connection to backend: httpd-UDS
[Sat Dec 17 01:16:14.438597 2016] [proxy:error] [pid 3156] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php71/root/usr/var/run/php-fpm/61d7d10ebd8abcb33d00b707c6391df70e9c0b80.sock (*) failed
[Sat Dec 17 01:16:14.438682 2016] [proxy_fcgi:error] [pid 3156] [client 104.206.223.21:42830] AH01079: failed to make connection to backend: httpd-UDS, referer: http://www.nirmoladda.com/
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello @Nirjonadda,

Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

Thank you.
 

dlook

Registered
Dec 18, 2016
2
0
1
USA
cPanel Access Level
Root Administrator
I'm having the same exact issue, it throws this randomly like 3 out of 4 times... Also the same error_log output. Had to turn the FPM off because site is in production and that is a bad look. Really disappointed in cPanel, since I vouched with my company to move all our stuff on VPS w/cPanel and now we can't fully use it.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello @dlook,

Could you verify how PHP-FPM was initially enabled on this system? For instance, was it manually enabled on cPanel version 58? Or, did you only start using PHP-FPM with the official support offered in cPanel version 60?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Here are some commands that will help with finding accounts with PHP-FPM enabled via the manual steps in cPanel version 58:

Code:
find /etc/apache2/conf.d/userdata/std/2_4/*/* -type f -name fpm.conf
find /etc/apache2/conf.d/userdata/ssl/2_4/*/* -type f -name fpm.conf
Do you notice any results when running these commands?

Thank you.
 

Bigwebmaster

Active Member
Dec 3, 2003
32
9
158
I was having this issue as well, still unsure of the cause or to why its happening, but I was able to fix it by restarting php-fpm:

systemctl restart ea-php70-php-fpm.service

That would change depending on what version of PHP is being used and causing the issues. As far as to the errors logged and what it is saying:

Jan 31 15:46:01 php-fpm: Tue Jan 31 15:46:01 2017 (715): Fatal Error Unable to create lock file: Bad file descriptor (9)
Jan 31 15:46:01 systemd: ea-php70-php-fpm.service: main process exited, code=exited, status=254/n/a
Jan 31 15:46:01 systemd: Failed to start The PHP FastCGI Process Manager.
Jan 31 15:46:01 systemd: Unit ea-php70-php-fpm.service entered failed state.
Jan 31 15:46:01 systemd: ea-php70-php-fpm.service failed.

This seems to only happen to us after rebooting the server. It also seems like it is common for the network interface to not be ready when Apache and PHP try to startup as we also have to restart Apache due to its failed state and errors:

Code:
Jan 31 15:46:01 restartsrv_httpd: (99)Cannot assign requested address: AH00072: make_sock: could not bind to address 173.236.19.54:80
Jan 31 15:46:01 restartsrv_httpd: no listening sockets available, shutting down
Jan 31 15:46:01 restartsrv_httpd: AH00015: Unable to open logs
Code:
[Tue Jan 31 15:56:21.474223 2017] [proxy_fcgi:error] [pid 4065:tid 140077204240128] [client 123.123.123.123:53412] AH01079: failed to make connection to backend: httpd-UDS
[Tue Jan 31 15:56:22.050771 2017] [proxy:error] [pid 4247:tid 140077204240128] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php70/root/usr/var/run/php-fpm/3ec4d2c6172cba2f558ff7fe63d570c1b88178d4.sock (*) failed
Seems that the server is booting too fast and the network isn't ready.

I haven't tried this yet, but this sounds promising:

Apache (httpd) failing to start on boot - CentOS 7
 

Bigwebmaster

Active Member
Dec 3, 2003
32
9
158
Thanks, I had actually figured this out before your post, but that is pretty much exactly what I did to solve the issue with Apache starting before the network was ready. Besides adding network0online.target I had also added ipaliases.service too:

Edit /etc/systemd/system/httpd.service
Add:

Code:
After=network-online.target ipaliases.service
At the end of the [Unit] section.
 
  • Like
Reactions: cPanelMichael
Sep 4, 2016
21
4
3
Greece
cPanel Access Level
Root Administrator
Twitter
Just a quick and dirty solution for everyone having the problem mentioned in the first message.

Visiting the site shows a "Service Unavailable" message.

The Apache error log files shows the following two lines:
Code:
[Sat Mar 18 11:57:43.669230 2017] [proxy:error] [pid 3804:tid 140452393080576] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php56/root/usr/var/run/php-fpm/hashed_domain.sock (*) failed
[Sat Mar 18 11:57:43.669380 2017] [proxy_fcgi:error] [pid 3804:tid 140452393080576] [client xxx.xxx.xxx.xxx:41569] AH01079: failed to make connection to backend: httpd-UDS
the problem was that there was no directory called php-fpm inside:
Code:
/opt/cpanel/ea-php56/root/usr/var/run.
I manually created the directory and restarted php-fpm service:
Code:
systemctl restart ea-php56-php-fpm.service
Now everything works fine.

cpanel version: WHM 62.0 (build 16) upgraded from a previous version. Can't remember right now which one.
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
cpanel version: WHM 62.0 (build 16) upgraded from a previous version. Can't remember right now which one.
Hello,

You'd still want to refer back to the following post to determine if PHP-FPM was enabled using an unsupported method:

Service Unavailable error with PHP-FPM

If so, it's important to revert the steps you took to enable it using the unsupported method and enable PHP-FPM via "WHM >> MultiPHP Manager". There's an additional thread on this topic at:

Your system contains an old PHP-FPM configuration - cPanel 60

Thank you.
 

000

Well-Known Member
Jun 3, 2008
427
18
68
Just a quick and dirty solution for everyone having the problem mentioned in the first message.

Visiting the site shows a "Service Unavailable" message.

The Apache error log files shows the following two lines:
Code:
[Sat Mar 18 11:57:43.669230 2017] [proxy:error] [pid 3804:tid 140452393080576] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /opt/cpanel/ea-php56/root/usr/var/run/php-fpm/hashed_domain.sock (*) failed
[Sat Mar 18 11:57:43.669380 2017] [proxy_fcgi:error] [pid 3804:tid 140452393080576] [client xxx.xxx.xxx.xxx:41569] AH01079: failed to make connection to backend: httpd-UDS
the problem was that there was no directory called php-fpm inside:
Code:
/opt/cpanel/ea-php56/root/usr/var/run.
I manually created the directory and restarted php-fpm service:
Code:
systemctl restart ea-php56-php-fpm.service
Now everything works fine.

cpanel version: WHM 62.0 (build 16) upgraded from a previous version. Can't remember right now which one.
hello, I get this:
Code:
[[email protected] ~]# systemctl restart ea-php7-php-fpm.service
Failed to restart ea-php7-php-fpm.service: Unit not found.
[[email protected] ~]#