Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved After a reboot, nginx does not start

    Support
    nginx certificates
    3
    9
    627
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jeau
      jeau App Dev last edited by girish

      I have these messages after a reboot attempt

      
      root@emendesfr-vt-prod-cloudron:/home/client_176_2# 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.
      
      
      root@emendesfr-vt-prod-cloudron:/home/client_176_2# systemctl status nginx.service
      ● nginx.service - nginx - high performance web server
         Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
        Drop-In: /etc/systemd/system/nginx.service.d
                 └─cloudron.conf
         Active: failed (Result: exit-code) since Tue 2022-02-15 23:23:07 UTC; 5s ago
           Docs: http://nginx.org/en/docs/
        Process: 27606 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
      
      févr. 15 23:23:07 emendesfr-vt-prod-cloudron systemd[1]: nginx.service: Service hold-off time over, scheduling restart.
      févr. 15 23:23:07 emendesfr-vt-prod-cloudron systemd[1]: nginx.service: Scheduled restart job, restart counter is at 5.
      févr. 15 23:23:07 emendesfr-vt-prod-cloudron systemd[1]: Stopped nginx - high performance web server.
      févr. 15 23:23:07 emendesfr-vt-prod-cloudron systemd[1]: nginx.service: Start request repeated too quickly.
      févr. 15 23:23:07 emendesfr-vt-prod-cloudron systemd[1]: nginx.service: Failed with result 'exit-code'.
      févr. 15 23:23:07 emendesfr-vt-prod-cloudron systemd[1]: Failed to start nginx - high performance web server.
      root@emendesfr-vt-prod-cloudron:/home/client_176_2#
      
      jeau 1 Reply Last reply Reply Quote 0
      • jeau
        jeau App Dev @jeau last edited by

        the journalctl -xeresult

        root@emendesfr-vt-prod-cloudron:/home/client_176_2# journalctl -xe
        -- Defined-By: systemd
        -- Support: http://www.ubuntu.com/support
        --
        -- L'unité (unit) nginx.service a échoué, avec le résultat RESULT.
        févr. 15 23:29:20 emendesfr-vt-prod-cloudron systemd[1]: nginx.service: Service hold-off time over, scheduling restart.
        févr. 15 23:29:20 emendesfr-vt-prod-cloudron systemd[1]: nginx.service: Scheduled restart job, restart counter is at 5.
        -- Subject: Le redémarrage automatique d'une unité (unit) a été planifié
        -- Defined-By: systemd
        -- Support: http://www.ubuntu.com/support
        --
        -- Le redémarrage automatique de l'unité (unit) nginx.service a été planifié, en
        -- raison de sa configuration avec le paramètre Restart=.
        févr. 15 23:29:20 emendesfr-vt-prod-cloudron systemd[1]: Stopped nginx - high performance web server.
        -- Subject: L'unité (unit) nginx.service a terminé son arrêt
        -- Defined-By: systemd
        -- Support: http://www.ubuntu.com/support
        --
        -- L'unité (unit) nginx.service a terminé son arrêt.
        févr. 15 23:29:20 emendesfr-vt-prod-cloudron systemd[1]: nginx.service: Start request repeated too quickly.
        févr. 15 23:29:20 emendesfr-vt-prod-cloudron systemd[1]: nginx.service: Failed with result 'exit-code'.
        févr. 15 23:29:20 emendesfr-vt-prod-cloudron systemd[1]: Failed to start nginx - high performance web server.
        -- Subject: L'unité (unit) nginx.service a échoué
        -- Defined-By: systemd
        -- Support: http://www.ubuntu.com/support
        --
        -- L'unité (unit) nginx.service a échoué, avec le résultat RESULT.
        févr. 15 23:29:23 emendesfr-vt-prod-cloudron sshd[31508]: Invalid user test02 from XX.XX.XX.XX port 42620
        févr. 15 23:29:23 emendesfr-vt-prod-cloudron sshd[31508]: pam_unix(sshd:auth): check pass; user unknown
        févr. 15 23:29:23 emendesfr-vt-prod-cloudron sshd[31508]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=92.255.8
        févr. 15 23:29:24 emendesfr-vt-prod-cloudron sshd[31508]: Failed password for invalid user test02 from XX.XX.XX.XX port 42620 ssh2
        févr. 15 23:29:24 emendesfr-vt-prod-cloudron sshd[31508]: Received disconnect from XX.XX.XX.XX port 42620:11: Bye Bye [preauth]
        févr. 15 23:29:24 emendesfr-vt-prod-cloudron sshd[31508]: Disconnected from invalid user test02 XX.XX.XX.XX port 42620 [preauth]
        lines 1530-1561/1561 (END)
        
        girish 1 Reply Last reply Reply Quote 0
        • girish
          girish Staff @jeau last edited by

          @jeau Do you have any stopped apps ? If so, I think the issue is that you have to delete their nginx configs under /home/yellowtent/platformdata/nginx/ (they will have the app id in the filename). After you delete those configs, systemctl restart nginx will bring it back up.

          S 1 Reply Last reply Reply Quote 2
          • girish
            girish Staff last edited by

            To give more context: in a previous release of Cloudron, we started deleting "old certs" ( > 6 months) . The certs of stopped apps is not renewed. This means that the nginx configs of stopped apps start referencing missing cert files and this causes nginx to not start. The fix is simply to remove those nginx configs. You can see which config is causing the issue from journalctl -u nginx -fa .

            jeau 1 Reply Last reply Reply Quote 1
            • jeau
              jeau App Dev @girish last edited by

              @girish great thanks, it's works. I have to clean up my old stuffs 😉

              However, I have a problem that I noticed before this event.

              I have an application that works but displays this error: Error : Nginx Error - Error reloading nginx: reload exited with code 1 signal null

              jeau 1 Reply Last reply Reply Quote 0
              • jeau
                jeau App Dev @jeau last edited by

                @jeau said in After a reboot, nginx does not start:

                Error : Nginx Error - Error reloading nginx: reload exited with code 1 signal null

                it's an active Wordpress app

                jeau 1 Reply Last reply Reply Quote 0
                • jeau
                  jeau App Dev @jeau last edited by

                  I restarted the application and it works correctly now ...
                  thanks @girish

                  1 Reply Last reply Reply Quote 2
                  • Referenced by  Z zylstra 
                  • S
                    stoccafisso @girish last edited by stoccafisso

                    Hi @girish

                    I have a similar problem (missing certificate so nginx does not start)

                    root@my:~# journalctl -u nginx -fa
                    -- Logs begin at Wed 2022-08-03 20:41:55 UTC. --
                    Aug 03 23:45:02 my nginx[17769]: nginx: [emerg] cannot load certificate key "/home/yellowtent/platformdata/nginx/cert/_.domainnamexxxx.info.key": PEM_read_bio_PrivateKey() failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line:Expecting: ANY PRIVATE KEY)
                    

                    I find app config files in /home/yellowtent/platformdata/nginx/applications

                    But the nginx-log messages does not tell what app exactly is creating the problem.

                    May I delete all config files, or do I have to go "trial and error" with each file to figure it out?

                    Where do I find the nginx config files for the app relating to the missing certificate?

                    S 1 Reply Last reply Reply Quote 0
                    • S
                      stoccafisso @stoccafisso last edited by

                      Problem solved. I deleted ALL config files and restarted the server.

                      1 Reply Last reply Reply Quote 1
                      • Referenced by  girish girish 
                      • First post
                        Last post
                      Powered by NodeBB