OMV - 502 Bad Gateway nginx

¿Quieres tener un Servidor o una Nube propia? Este es tu sitio!
Responder
nodaro
Pi Newbie
Pi Newbie
Mensajes: 5
Registrado: 05 Abr 2018, 10:00
Agradecido: 0
Agradecimiento recibido: 0

He instalado la última versión de OMV, insatalando Raspberry Pi Lite OS, desde la herramienta oficial de la web del S.O. y tras hacer el update y el upgrade, ejecutar el script oficial de instalación.
Es cierto que lo estoy instalando en una raspberry pi 2B y parce que tarda bastante (más de 1 hora), pero el proceso se completa y la raspberry se reinicia automáticamente.

El problema viene al acceder vía web, la raspberry me devuelve un error "502 Bad Gateway - nginx".

He estado buscando y parece que puede ser un problema del servicio PHP7.3, que no está activo. De hecho si lanzo un "ps -aux | grep php", no muestra ningún servicio.
He leído que una posible solución es lanzando estos comandos:

Código: Seleccionar todo

1# sudo omv-salt deploy run nginx
2# sudo omv-salt deploy run phpfpm
En el caso 1#, el resultado es satisfactorio:

Código: Seleccionar todo

Summary for raspberrypi
------------
Succeeded: 8 (changed=4)
Failed:    0
------------
Total states run:     8
Total run time:  69.218 s

En el caso 2# el resultado es KO para los 3 últimos servicios:

Código: Seleccionar todo

          ID: test_phpfpm_service_config
    Function: cmd.run
        Name: php-fpm7.3 --test
      Result: False
     Comment: Command "php-fpm7.3 --test" run
     Started: 07:39:52.621077
    Duration: 355.073 ms
     Changes:
              ----------
              pid:
                  9962
              retcode:
                  -4
              stderr:
              stdout:
----------
          ID: restart_phpfpm_service
    Function: service.running
        Name: php7.3-fpm
      Result: False
     Comment: One or more requisite failed: omv.deploy.phpfpm.default.test_phpfpm_service_config
     Started: 07:39:53.279794
    Duration: 0.132 ms
     Changes:
----------
          ID: monitor_phpfpm_service
    Function: module.run
        Name: monit.monitor
      Result: False
     Comment: One or more requisite failed: omv.deploy.phpfpm.default.restart_phpfpm_service
     Started: 07:39:53.308567
    Duration: 0.132 ms
     Changes:

Summary for raspberrypi
------------
Succeeded: 2 (changed=2)
Failed:    3
------------
Total states run:     5
Total run time:  28.455 s

He realizado la instalación 2 veces completas, con el mismo resultado.

¿Alguna idea de como se puede solucionar o cual es el origen del problema?
Avatar de Usuario
egrueda
Pi God
Pi God
Mensajes: 3426
Registrado: 10 Feb 2017, 19:31
Agradecido: 7 veces
Agradecimiento recibido: 269 veces

nodaro escribió: 14 Feb 2021, 09:01 El problema viene al acceder vía web, la raspberry me devuelve un error "502 Bad Gateway - nginx".
Vale, si el error te lo está dando nginx, ¿qué dice el registro de nginx?
nodaro
Pi Newbie
Pi Newbie
Mensajes: 5
Registrado: 05 Abr 2018, 10:00
Agradecido: 0
Agradecimiento recibido: 0

Cómo puedo ver el registro?
Me declaro desconocedor de todo el ecosistema OMV, nginx incluido
nodaro
Pi Newbie
Pi Newbie
Mensajes: 5
Registrado: 05 Abr 2018, 10:00
Agradecido: 0
Agradecimiento recibido: 0

Tengo esto para el log de errores de nginx, recién iniciada la raspberry.

Para /var/log/nginx/error.log:

Código: Seleccionar todo

2021/02/15 08:48:02 [alert] 616#616: *4 open socket #12 left in connection 3
2021/02/15 08:48:02 [alert] 616#616: aborting
pi@raspberrypi:/var/log/nginx $
para /var/log/nginx/openmediavault-webgui_error.log:

Código: Seleccionar todo

2021/02/15 08:46:26 [crit] 616#616: *1 connect() to unix:/run/php/php7.3-fpm-openmediavault-webgui.sock failed (2: No such file or directory) while connecting to upstream, client: ::ffff:127.0.0.1, server: openmediavault-webgui, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm-openmediavault-webgui.sock:", host: "127.0.0.1"
2021/02/15 08:47:27 [crit] 616#616: *3 connect() to unix:/run/php/php7.3-fpm-openmediavault-webgui.sock failed (2: No such file or directory) while connecting to upstream, client: ::ffff:192.168.100.4, server: openmediavault-webgui, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm-openmediavault-webgui.sock:", host: "192.168.100.6"
2021/02/15 08:47:30 [crit] 616#616: *3 connect() to unix:/run/php/php7.3-fpm-openmediavault-webgui.sock failed (2: No such file or directory) while connecting to upstream, client: ::ffff:192.168.100.4, server: openmediavault-webgui, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm-openmediavault-webgui.sock:", host: "192.168.100.6"
2021/02/15 08:47:31 [crit] 616#616: *3 connect() to unix:/run/php/php7.3-fpm-openmediavault-webgui.sock failed (2: No such file or directory) while connecting to upstream, client: ::ffff:192.168.100.4, server: openmediavault-webgui, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm-openmediavault-webgui.sock:", host: "192.168.100.6"
Para /var/log/nginx/openmediavault-webgui_access.log:

Código: Seleccionar todo

::ffff:127.0.0.1 - - [15/Feb/2021:08:46:26 +0000] "GET / HTTP/1.1" 502 166 "-" "Monit/5.25.2"
::ffff:192.168.100.4 - - [15/Feb/2021:08:47:27 +0000] "GET / HTTP/1.1" 502 568 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"
::ffff:192.168.100.4 - - [15/Feb/2021:08:47:27 +0000] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.100.6/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"
::ffff:192.168.100.4 - - [15/Feb/2021:08:47:30 +0000] "GET / HTTP/1.1" 502 568 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"
::ffff:192.168.100.4 - - [15/Feb/2021:08:47:30 +0000] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.100.6/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"
::ffff:192.168.100.4 - - [15/Feb/2021:08:47:31 +0000] "GET / HTTP/1.1" 502 568 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"
::ffff:192.168.100.4 - - [15/Feb/2021:08:47:31 +0000] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.100.6/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"
::ffff:192.168.100.4 - - [15/Feb/2021:08:47:31 +0000] "GET / HTTP/1.1" 502 568 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"
::ffff:192.168.100.4 - - [15/Feb/2021:08:47:31 +0000] "GET /favicon.ico HTTP/1.1" 200 1406 "http://192.168.100.6/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"
::ffff:127.0.0.1 - - [15/Feb/2021:08:47:57 +0000] "GET / HTTP/1.1" 502 166 "-" "Monit/5.25.2"
::ffff:127.0.0.1 - - [15/Feb/2021:08:49:35 +0000] "GET / HTTP/1.1" 502 166 "-" "Monit/5.25.2"
::ffff:127.0.0.1 - - [15/Feb/2021:08:51:08 +0000] "GET / HTTP/1.1" 502 166 "-" "Monit/5.25.2"
::ffff:192.168.100.4 - - [15/Feb/2021:08:51:29 +0000] "GET / HTTP/1.1" 502 568 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"
::ffff:192.168.100.4 - - [15/Feb/2021:08:51:44 +0000] "GET / HTTP/1.1" 502 568 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"
::ffff:127.0.0.1 - - [15/Feb/2021:08:52:41 +0000] "GET / HTTP/1.1" 502 166 "-" "Monit/5.25.2"
::ffff:127.0.0.1 - - [15/Feb/2021:08:54:13 +0000] "GET / HTTP/1.1" 502 166 "-" "Monit/5.25.2"
::ffff:127.0.0.1 - - [15/Feb/2021:08:55:46 +0000] "GET / HTTP/1.1" 502 166 "-" "Monit/5.25.2"
::ffff:127.0.0.1 - - [15/Feb/2021:08:57:19 +0000] "GET / HTTP/1.1" 502 166 "-" "Monit/5.25.2"
::ffff:127.0.0.1 - - [15/Feb/2021:08:58:52 +0000] "GET / HTTP/1.1" 502 166 "-" "Monit/5.25.2"
nodaro
Pi Newbie
Pi Newbie
Mensajes: 5
Registrado: 05 Abr 2018, 10:00
Agradecido: 0
Agradecimiento recibido: 0

También he intentado reinstalar el servicio php 7.3 y reiniciar el nginx, sin éxito:

Código: Seleccionar todo

pi@raspberrypi:/var/log/nginx $ sudo apt-get install php7.3-fpm
Reading package lists... Done
Building dependency tree
Reading state information... Done
php7.3-fpm is already the newest version (7.3.19-1~deb10u1).
php7.3-fpm set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

pi@raspberrypi:/var/log/nginx $ sudo service nginx restart

pi@raspberrypi:/var/log/nginx $ sudo service php7.3-fpm restart
Job for php7.3-fpm.service failed because a fatal signal was delivered to the control process.
See "systemctl status php7.3-fpm.service" and "journalctl -xe" for details.

pi@raspberrypi:/var/log/nginx $ systemctl status php7.3-fpm.service
● php7.3-fpm.service - The PHP 7.3 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.3-fpm.service; enabled; vendor preset: enabled)
   Active: failed (Result: signal) since Mon 2021-02-15 09:09:20 GMT; 7s ago
     Docs: man:php-fpm7.3(8)
  Process: 2438 ExecStart=/usr/sbin/php-fpm7.3 --nodaemonize --fpm-config /etc/php/7.3/fpm/php-fpm.conf (code=killed, signal=ILL)
 Main PID: 2438 (code=killed, signal=ILL)

Feb 15 09:09:20 raspberrypi systemd[1]: Starting The PHP 7.3 FastCGI Process Manager...
Feb 15 09:09:20 raspberrypi systemd[1]: php7.3-fpm.service: Main process exited, code=killed, status=4/ILL
Feb 15 09:09:20 raspberrypi systemd[1]: php7.3-fpm.service: Failed with result 'signal'.
Feb 15 09:09:20 raspberrypi systemd[1]: Failed to start The PHP 7.3 FastCGI Process Manager.

pi@raspberrypi:/var/log/nginx $ journalctl -xe
Feb 15 09:09:20 raspberrypi systemd[1]: php7.3-fpm.service: Main process exited, code=killed, status=4/ILL
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStart= process belonging to unit php7.3-fpm.service has exited.
--
-- The process' exit code is 'killed' and its exit status is 4.
Feb 15 09:09:20 raspberrypi systemd[1]: php7.3-fpm.service: Failed with result 'signal'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit php7.3-fpm.service has entered the 'failed' state with result 'signal'.
Feb 15 09:09:20 raspberrypi systemd[1]: Failed to start The PHP 7.3 FastCGI Process Manager.
-- Subject: A start job for unit php7.3-fpm.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit php7.3-fpm.service has finished with a failure.
--
-- The job identifier is 4363 and the job result is failed.
Feb 15 09:09:50 raspberrypi monit[680]: 'php-fpm' failed to start (exit status 1) -- '/bin/systemctl start php7.3-fpm': Job for php7.3-fpm.service f
                                        See "systemctl status php7.3-fpm.service" and "journalctl -xe" for details.
Feb 15 09:09:50 raspberrypi monit[680]: 'nginx' failed protocol test [HTTP] at [127.0.0.1]:80 [TCP/IP] -- HTTP error: Server returned status 502
Feb 15 09:09:50 raspberrypi monit[680]: 'nginx' trying to restart
Feb 15 09:09:50 raspberrypi monit[680]: 'nginx' stop: '/bin/systemctl stop nginx'
Feb 15 09:09:50 raspberrypi systemd[1]: Stopping A high performance web server and a reverse proxy server...
-- Subject: A stop job for unit nginx.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A stop job for unit nginx.service has begun execution.
--
-- The job identifier is 4432.
Feb 15 09:09:50 raspberrypi systemd[1]: nginx.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit nginx.service has successfully entered the 'dead' state.
Feb 15 09:09:50 raspberrypi systemd[1]: Stopped A high performance web server and a reverse proxy server.
-- Subject: A stop job for unit nginx.service has finished
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A stop job for unit nginx.service has finished.
--
-- The job identifier is 4432 and the job result is done.
Feb 15 09:09:50 raspberrypi monit[680]: 'nginx' start: '/bin/systemctl start nginx'
Feb 15 09:09:51 raspberrypi systemd[1]: Starting A high performance web server and a reverse proxy server...
-- Subject: A start job for unit nginx.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit nginx.service has begun execution.
--
-- The job identifier is 4433.
lines 3923-3980/3980 (END)
Responder