Error 503 after "Use Socket for PHP-FPM" Ubuntu 20.04

Discussion in 'ISPConfig 3 Priority Support' started by chico11mbit, Nov 3, 2021.

  1. chico11mbit

    chico11mbit Member

    Hi, I use an Ubuntu 20.04 Server with ISPconfig 3.2.7p1.
    When I check "Use Socket for PHP-FPM" or "Chroot PHP-FPM" or both together, I get a 503 error on the page. The other pages are ok.
    How can I correct this error?

    Kind regards
    chico
     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Check the error log for more info
     
  3. chico11mbit

    chico11mbit Member

    ok. It seems the error only occurs when I check Chroot PHP-FPM. With or without "Use Socket for PHP-FPM".
    What error.log do you mean? The one in /var/log/apache2 or the one in the /var/www/domain/log/ (this one has 0 bytes) ?
     
  4. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    I'd start with the site's error.log, but if that doesn't show anything, check the general apache /var/log/apache2/error.log and the log file for the php daemon (/var/log/php*-fpm.log). My guess is the php environment in that jail is incomplete for what the site needs, and the solution will be adding something more to it.
     
  5. chico11mbit

    chico11mbit Member

    I use php-fpm – php7.0 on this site. That is not the default php version. Nevertheless it is not working with the default either.

    The error in web browser is:
    Error 503
    Site temporarily unavailable

    I get these log entries:
    Code:
    /var/log/php7.0-fpm.log
    
    Reloading in progress ...
    [04-Nov-2021 20:09:19] NOTICE: reloading: execvp("/usr/sbin/php-fpm7.0", {"/usr/sbin/php-fpm7.0", "--nodaemonize", "--fpm-config", "/etc/php/7.0/fpm/php-fpm.conf"})
    [04-Nov-2021 20:09:19] NOTICE: using inherited socket fd=7, "127.0.0.1:9146"
    [04-Nov-2021 20:09:19] NOTICE: using inherited socket fd=7, "127.0.0.1:9146"
    [04-Nov-2021 20:09:19] NOTICE: using inherited socket fd=10, "/run/php/php7.0-fpm.sock"
    [04-Nov-2021 20:09:19] NOTICE: using inherited socket fd=10, "/run/php/php7.0-fpm.sock"
    [04-Nov-2021 20:09:19] NOTICE: using inherited socket fd=9, "127.0.0.1:9054"
    [04-Nov-2021 20:09:19] NOTICE: using inherited socket fd=9, "127.0.0.1:9054"
    [04-Nov-2021 20:09:19] NOTICE: using inherited socket fd=8, "/var/lib/php7.4-fpm/web19.sock"
    [04-Nov-2021 20:09:19] NOTICE: using inherited socket fd=8, "/var/lib/php7.4-fpm/web19.sock"
    [04-Nov-2021 20:09:19] NOTICE: fpm is running, pid 838
    [04-Nov-2021 20:09:19] NOTICE: ready to handle connections
    [04-Nov-2021 20:09:19] NOTICE: systemd monitor interval set to 10000ms
    
    
    
    /var/log/apache2/error.log
    
    [ 2021-11-04 20:09:19.2636 463011/7f4e4ffff700 age/Cor/CoreMain.cpp:531 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
    [ 2021-11-04 20:09:19.2637 463011/7f4e54b92e40 age/Cor/CoreMain.cpp:900 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
    [ 2021-11-04 20:09:19.2637 463027/7f7459e5fe40 age/Ust/UstRouterMain.cpp:491 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
    [ 2021-11-04 20:09:19.2637 463027/7f74594e8700 Ser/Server.h:816 ]: [UstRouterApiServer] Freed 0 spare client objects
    [ 2021-11-04 20:09:19.2638 463027/7f74594e8700 Ser/Server.h:464 ]: [UstRouterApiServer] Shutdown finished
    [ 2021-11-04 20:09:19.2638 463011/7f4e4ffff700 Ser/Server.h:816 ]: [ServerThr.1] Freed 128 spare client objects
    [ 2021-11-04 20:09:19.2638 463011/7f4e4ffff700 Ser/Server.h:464 ]: [ServerThr.1] Shutdown finished
    [ 2021-11-04 20:09:19.2638 463011/7f4e4effd700 Ser/Server.h:816 ]: [ServerThr.3] Freed 128 spare client objects
    [ 2021-11-04 20:09:19.2638 463011/7f4e4effd700 Ser/Server.h:464 ]: [ServerThr.3] Shutdown finished
    [ 2021-11-04 20:09:19.2639 463027/7f7459d6a700 Ser/Server.h:464 ]: [UstRouter] Shutdown finished
    [ 2021-11-04 20:09:19.2639 463011/7f4e4df7a700 Ser/Server.h:816 ]: [ApiServer] Freed 0 spare client objects
    [ 2021-11-04 20:09:19.2639 463011/7f4e4df7a700 Ser/Server.h:464 ]: [ApiServer] Shutdown finished
    [ 2021-11-04 20:09:19.2646 463027/7f7459e5fe40 age/Ust/UstRouterMain.cpp:523 ]: Passenger UstRouter shutdown finished
    [ 2021-11-04 20:09:19.2651 463011/7f4e4f7fe700 Ser/Server.h:816 ]: [ServerThr.2] Freed 128 spare client objects
    [ 2021-11-04 20:09:19.2654 463011/7f4e4e7fc700 Ser/Server.h:816 ]: [ServerThr.4] Freed 128 spare client objects
    
    [ 2021-11-04 20:09:19.2656 463011/7f4e4ffff700 age/Cor/CoreMain.cpp:531 ]: Signal received. Gracefully shutting down... (send signal 1 more time(s) to force shutdown)
    [ 2021-11-04 20:09:19.2660 463011/7f4e4e7fc700 Ser/Server.h:464 ]: [ServerThr.4] Shutdown finished
    [ 2021-11-04 20:09:19.2663 463011/7f4e4f7fe700 Ser/Server.h:464 ]: [ServerThr.2] Shutdown finished
    [ 2021-11-04 20:09:19.3282 463011/7f4e54b92e40 age/Cor/CoreMain.cpp:967 ]: Passenger core shutdown finished
    [ 2021-11-04 20:09:19.4788 508768/7f4f4bb66e40 age/Wat/WatchdogMain.cpp:1291 ]: Starting Passenger watchdog...
    [ 2021-11-04 20:09:19.4878 508771/7f7ae7b18e40 age/Cor/CoreMain.cpp:982 ]: Starting Passenger core...
    [ 2021-11-04 20:09:19.4879 508771/7f7ae7b18e40 age/Cor/CoreMain.cpp:235 ]: Passenger core running in multi-application mode.
    [ 2021-11-04 20:09:19.4890 508771/7f7ae7b18e40 age/Cor/CoreMain.cpp:732 ]: Passenger core online, PID 508771
    [ 2021-11-04 20:09:19.4987 508787/7f88531e7e40 age/Ust/UstRouterMain.cpp:529 ]: Starting Passenger UstRouter...
    [ 2021-11-04 20:09:19.5000 508787/7f88531e7e40 age/Ust/UstRouterMain.cpp:342 ]: Passenger UstRouter online, PID 508787
    [Thu Nov 04 20:09:19.500305 2021] [suexec:notice] [pid 508756:tid 140104326880320] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
    
    [ 2021-11-04 20:09:19.5014 508771/7f7ae7149700 age/Cor/CoreMain.cpp:531 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
    [ 2021-11-04 20:09:19.5017 508771/7f7ae7b18e40 age/Cor/CoreMain.cpp:900 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
    [ 2021-11-04 20:09:19.5021 508771/7f7ae68c7700 Ser/Server.h:816 ]: [ServerThr.2] Freed 128 spare client objects
    [ 2021-11-04 20:09:19.5025 508771/7f7ae6045700 Ser/Server.h:816 ]: [ServerThr.3] Freed 128 spare client objects
    [ 2021-11-04 20:09:19.5028 508771/7f7ae57c3700 Ser/Server.h:816 ]: [ServerThr.4] Freed 128 spare client objects
    [ 2021-11-04 20:09:19.5031 508771/7f7ae57c3700 Ser/Server.h:464 ]: [ServerThr.4] Shutdown finished
    [ 2021-11-04 20:09:19.5033 508771/7f7ae6045700 Ser/Server.h:464 ]: [ServerThr.3] Shutdown finished
    [ 2021-11-04 20:09:19.5036 508771/7f7ae7149700 Ser/Server.h:816 ]: [ServerThr.1] Freed 128 spare client objects
    [ 2021-11-04 20:09:19.5036 508771/7f7ae7149700 Ser/Server.h:464 ]: [ServerThr.1] Shutdown finished
    [ 2021-11-04 20:09:19.5037 508771/7f7ae68c7700 Ser/Server.h:464 ]: [ServerThr.2] Shutdown finished
    
    [ 2021-11-04 20:09:19.5044 508787/7f88530f2700 age/Ust/UstRouterMain.cpp:421 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
    [ 2021-11-04 20:09:19.5046 508787/7f88531e7e40 age/Ust/UstRouterMain.cpp:491 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
    [ 2021-11-04 20:09:19.5047 508787/7f8852870700 Ser/Server.h:816 ]: [UstRouterApiServer] Freed 0 spare client objects
    [ 2021-11-04 20:09:19.5047 508787/7f8852870700 Ser/Server.h:464 ]: [UstRouterApiServer] Shutdown finished
    [ 2021-11-04 20:09:19.5052 508771/7f7ae4f41700 Ser/Server.h:816 ]: [ApiServer] Freed 0 spare client objects
    [ 2021-11-04 20:09:19.5054 508771/7f7ae4f41700 Ser/Server.h:464 ]: [ApiServer] Shutdown finished
    [ 2021-11-04 20:09:19.5057 508787/7f88530f2700 Ser/Server.h:464 ]: [UstRouter] Shutdown finished
    [ 2021-11-04 20:09:19.5062 508787/7f88531e7e40 age/Ust/UstRouterMain.cpp:523 ]: Passenger UstRouter shutdown finished
    [ 2021-11-04 20:09:19.5548 508803/7f8b23a18e40 age/Wat/WatchdogMain.cpp:1291 ]: Starting Passenger watchdog...
    [ 2021-11-04 20:09:19.5638 508806/7f10c7a3ee40 age/Cor/CoreMain.cpp:982 ]: Starting Passenger core...
    [ 2021-11-04 20:09:19.5639 508806/7f10c7a3ee40 age/Cor/CoreMain.cpp:235 ]: Passenger core running in multi-application mode.
    [ 2021-11-04 20:09:19.5650 508806/7f10c7a3ee40 age/Cor/CoreMain.cpp:732 ]: Passenger core online, PID 508806
    [ 2021-11-04 20:09:19.5672 508771/7f7ae7b18e40 age/Cor/CoreMain.cpp:967 ]: Passenger core shutdown finished
    [ 2021-11-04 20:09:19.5738 508815/7f887d98de40 age/Ust/UstRouterMain.cpp:529 ]: Starting Passenger UstRouter...
    [ 2021-11-04 20:09:19.5744 508815/7f887d98de40 age/Ust/UstRouterMain.cpp:342 ]: Passenger UstRouter online, PID 508815
    [Thu Nov 04 20:09:19.574752 2021] [:error] [pid 508799:tid 140104326880320] python_init: Python version mismatch, expected '2.7.17', found '2.7.18'.
    [Thu Nov 04 20:09:19.574823 2021] [:error] [pid 508799:tid 140104326880320] python_init: Python executable found ''.
    [Thu Nov 04 20:09:19.574828 2021] [:error] [pid 508799:tid 140104326880320] python_init: Python path being used '/lib/python2.7:/lib/python2.7/plat-x86_64-linux-gnu:/lib/python2.7/lib-tk:/lib/python2.7/lib-old:/lib/python2.7/lib-dynload'.
    [Thu Nov 04 20:09:19.574845 2021] [:notice] [pid 508799:tid 140104326880320] mod_python: Creating 8 session mutexes based on 6 max processes and 25 max threads.
    [Thu Nov 04 20:09:19.574850 2021] [:notice] [pid 508799:tid 140104326880320] mod_python: using mutex_directory /tmp
    [Thu Nov 04 20:09:19.624859 2021] [mpm_event:notice] [pid 508799:tid 140104326880320] AH00489: Apache/2.4.41 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1f Phusion_Passenger/5.0.30 mod_python/3.3.1 Python/2.7.18 configured -- resuming normal operations
    [Thu Nov 04 20:09:19.624885 2021] [core:notice] [pid 508799:tid 140104326880320] AH00094: Command line: '/usr/sbin/apache2'
     
  6. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Maybe try creating a test site with the same php version in chroot mode and a simple phpinfo() page and see if that runs. If not, and in the absence of further errors, I'd probably attach to the php7.0-fpm daemon with strace and run that same phpinfo script and see what that shows.
     
  7. chico11mbit

    chico11mbit Member

    Hmm. the info.php is working. But the website, running under MODX revolution 2.8 not.
    On the newest Wordpress Version on another site i got "Error establishing a database connection"
    Weird
     
    Last edited: Nov 5, 2021
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    When using chroot, you must use 127.0.0.1 and not 'localhost' as database server hostname. The word 'localhost' in PHP is sued to switch to a socket connection, which can't work when being in a chroot as the global MySQL socket is not reachable from within the chroot, so you must use the localhost IP 127.0.0.1 instead.
     

Share This Page