The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Service Unavailable error with PHP-FPM

Discussion in 'EasyApache' started by Nirjonadda, Dec 7, 2016.

Tags:
  1. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    341
    Likes Received:
    8
    Trophy Points:
    18
    cPanel Access Level:
    Website Owner
    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.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    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.
     
  3. Nirjonadda

    Nirjonadda Well-Known Member

    Joined:
    May 8, 2013
    Messages:
    341
    Likes Received:
    8
    Trophy Points:
    18
    cPanel Access Level:
    Website Owner
    /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/
     
    #3 Nirjonadda, Dec 16, 2016
    Last edited: Dec 17, 2016
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  5. dlook

    dlook Registered

    Joined:
    Dec 18, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  7. dlook

    dlook Registered

    Joined:
    Dec 18, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    We updated from V 54 I think, first to 56 and then it offered to update to 60, after all updates we turned FPM on.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  9. Bigwebmaster

    Bigwebmaster Active Member

    Joined:
    Dec 3, 2003
    Messages:
    26
    Likes Received:
    8
    Trophy Points:
    153
    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
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You may also find this post helpful:

    SOLVED - Apache Service won't start

    Thank you.
     
  11. Bigwebmaster

    Bigwebmaster Active Member

    Joined:
    Dec 3, 2003
    Messages:
    26
    Likes Received:
    8
    Trophy Points:
    153
    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.
     
    cPanelMichael likes this.
  12. vikelidiskostas

    Joined:
    Sep 4, 2016
    Messages:
    8
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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.
     
    #12 vikelidiskostas, Mar 18, 2017
    Last edited: Mar 18, 2017
  13. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page