Nginx failed start

  • Hello,

    I have a problem on OMV's Nginx server, so I can't connect to the web interface.


    So I typed the following command


    Code
    nginx.service - A high performance web server and a reverse proxy server     
    Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
         Active: failed (Result: exit-code) since Mon 2023-01-09 12:31:51 CET; 32s ago
           Docs: man:nginx(8)
        Process: 81526 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
            CPU: 7ms


    Once this error, I wanted to restart Nginx. With this error.

    Code
    Failed to start nginx.service: Access denied
    See system logs and 'systemctl status nginx.service' for details.


    I then tried to reinstall.

    But still errors.

    I'm a little limited.

  • […]

    It's better if you explain in detail what you did to OMV before this happened.

  • I wanted to install a web server. But I must have made a mistake with my Docker.

    And this still doesn't explain nothing.
    If you messed with docker pointing to the nginx of the host, sh*t will keep on happening.


    You can try to run these commands but since you don't say EXACTLY what you did, there's no knowing it will work.

    Post all outputs (including command in a codebox)


    sudo omv-salt deploy run nginx phpfpm


    sudo systemctl restart nginx

    sudo systemctl restart php7.4-fpm


    sudo nginx -t

  • Code
    sudo systemctl restart nginx
    Job for nginx.service failed because the control process exited with error code.
    See "systemctl status nginx.service" and "journalctl -xe" for details.
    Code
    sudo systemctl restart php7.4-fpm
    Code
    sudo nginx -t
    nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
    nginx: configuration file /etc/nginx/nginx.conf test failed
  • Code
    dpkg -l | grep openm
    ii  openmediavault                     6.1.4-2                        all          openmediavault - The open network attached storage solution
    ii  openmediavault-backup              6.1                            all          backup plugin for OpenMediaVault.
    ii  openmediavault-keyring             1.0                            all          GnuPG archive keys of the OpenMediaVault archive
    ii  openmediavault-nut                 6.0.1-1                        all          openmediavault Network UPS Tools (NUT) plugin
    ii  openmediavault-omvextrasorg        6.1.1                          all          OMV-Extras.org Package Repositories for OpenMediaVault
    ii  openmediavault-rsnapshot           6.0.2                          all          OpenMediaVault rsnapshot backup plugin.
    Code
    dpkg -l | grep nginx
    ii  libnginx-mod-http-geoip            1.18.0-6.1+deb11u3             amd64        GeoIP HTTP module for Nginx
    ii  libnginx-mod-http-image-filter     1.18.0-6.1+deb11u3             amd64        HTTP image filter module for Nginx
    ii  libnginx-mod-http-xslt-filter      1.18.0-6.1+deb11u3             amd64        XSLT Transformation module for Nginx
    ii  libnginx-mod-mail                  1.18.0-6.1+deb11u3             amd64        Mail module for Nginx
    ii  libnginx-mod-stream                1.18.0-6.1+deb11u3             amd64        Stream module for Nginx
    ii  libnginx-mod-stream-geoip          1.18.0-6.1+deb11u3             amd64        GeoIP Stream module for Nginx
    ii  nginx                              1.18.0-6.1+deb11u3             all          small, powerful, scalable web/proxy server
    ii  nginx-common                       1.18.0-6.1+deb11u3             all          small, powerful, scalable web/proxy server - common files
    ii  nginx-core                         1.18.0-6.1+deb11u3             amd64        nginx web/proxy server (standard version)
    Code
    ls -al /etc/nginx/
    total 20
    drwxr-xr-x  3 root root 4096 Jan  9 12:32 .
    drwxr-xr-x 99 root root 4096 Jan  9 12:19 ..
    -rw-r--r--  1 root root 1031 Jan  9 12:31 nginx.service
    drwxr-xr-x  2 root root 4096 Jan  9 12:02 openmediavault-webgui.d
    -rw-r--r--  1 root root  523 Jan  9 12:32 php7.4-fpm.service
  • I really don't know what you did other than the nginx folder should look like this:


    Do you have any docker container pointing to that folder on the host???

    Or did you ran any apt install nginx on the CLI or something similar???


    By running the salt command, the folder should be recreated with the proper files but it's not.


    What is the output of:

    sudo docker ps -a

  • I wanted to reinstall nginx en with a apt install nginx


    Code
    sudo docker ps -a
    CONTAINER ID   IMAGE                                          COMMAND                  CREATED        STATUS        PORTS                                                                                            NAMES
    ef2f9a930833   nextcloud                                      "/entrypoint.sh apac…"   11 hours ago   Up 11 hours   0.0.0.0:7070->80/tcp, :::7070->80/tcp                                                            nextcloud-nextcloud_app-1
    6073e9d29ca9   mariadb                                        "docker-entrypoint.s…"   11 hours ago   Up 11 hours   3306/tcp                                                                                         nextcloud_db
    0a3b77b7593c   adguard/adguardhome                            "/opt/adguardhome/Ad…"   12 hours ago   Up 12 hours                                                                                                    adguardhome
    cddb9531f8f8   ghcr.io/home-assistant/home-assistant:stable   "/init"                  29 hours ago   Up 29 hours                                                                                                    homeassistant
    5e583d041b40   jc21/nginx-proxy-manager:latest                "/init"                  32 hours ago   Up 29 hours   0.0.0.0:80-81->80-81/tcp, :::80-81->80-81/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp             revers-proxy-app-1
    e245f7918f1f   portainer/portainer-ee                         "/portainer"             32 hours ago   Up 30 hours   0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp, 9443/tcp   portainer
  • I wanted to reinstall nginx en with a apt install nginx

    Ok, this explains better.

    To clean this, the fastest way (that I know) is to just run the OMV install script to force clean all install.

    Since your OMV is still good (apart the GUI issue) there's no problem in doing it.


    Quote
    • This script will install openmediavault, omv-extras, and flashmemory. If you already have openmediavault installed don't worry, your openmediavault will be preserved, only the not installed will be added to the system.


    BUT, in order to be safe, making a backup of the OS is the first thing to be done.

    After the backup is done AND TESTED, than it's only a matter of running:


    Code
    sudo wget -O - https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install | sudo bash



    One thing I know you'll have problems is with this:

    5e583d041b40 jc21/nginx-proxy-manager:latest "/init" 32 hours ago Up 29 hours 0.0.0.0:80-81->80-81/tcp

    Your NPM is running on port 80

    You'll need to stop it first and after OMV is finally running OK, you'll have to change the port OMV uses and only then, can you restart the NPM container.

  • Still 5 errors related to Nginx

    Code
    sudo wget -O - https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install | sudo bash
    Synchronizing state of proftpd.service with SysV service script with /lib/systemd/systemd-sysv-install.
    Executing: /lib/systemd/systemd-sysv-install disable proftpd
    Removed /etc/systemd/system/multi-user.target.wants/proftpd.service.
    Done.
  • Just to rule out something, what's the output of:

    sudo docker inspect -f '{{ json .Mounts }}' 5e583d041b40 | jq


    sudo docker inspect -f '{{ json .Mounts }}' cddb9531f8f8 | jq

  • Just to rule out something, what's the output of:

    sudo docker inspect -f '{{ json .Mounts }}' 5e583d041b40 | jq


    sudo docker inspect -f '{{ json .Mounts }}' cddb9531f8f8 | jq


    Code
    sudo docker inspect -f '{{ json .Mounts }}' 5e583d041b40 | jq
    -bash: sudo docker: command not found


    Code
    sudo docker inspect -f '{{ json .Mounts }}' cddb9531f8f8 | jq
    "docker inspect" requires at least 1 argument.
    See 'docker inspect --help'.
    
    Usage:  docker inspect [OPTIONS] NAME|ID [NAME|ID...]
    
    Return low-level information on Docker objects

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!