Nginx failing at boot 100% of the time, fine after restarting service

My YunoHost server

Hardware: Raspberry Pi 3 at home
YunoHost version: 11.1.15
I have access to my server : Through SSH and through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
If yes, please explain:

Description of my issue

My server is periodically shutting down. I’m looking into whether it’s the power supply on board, the power cord, the outlet, the fuses, or whatever. Any suggestions for troubleshooting or discovering other possible causes are welcome, but that’s not why I’m here.

Whenever I do get it to come back online, nginx fails. I can’t see my server’s login page and I can’t get to the webadmin. I can SSH and run sudo yunohost service restart nginx to get it up and running again, but I’d like to figure out why it’s failing on boot-up every time.

I couldn’t get the yunopaste command to work at all so I saved the logs before restarting it the last time as a text file. I looked under /var/log/nginx/error.log: and found mostly these two statements repeating:

[warn] 1925#1925: "ssl_stapling" ignored, host not found in OCSP responder "r3.o.lencr.org" in the certificate "/etc/yunohost/certs/[myserver]/crt.pem"

and

[warn] 1925#1925: could not build optimal variables_hash, you should increase either variables_hash_max_size: 1024 or variables_hash_bucket_size: 64; ignoring variables_hash_bucket_size

but I don’t know what either of these mean or how to fix them. Or if these are even the causes of my problem.

# /usr/sbin/nginx -t
nginx: [warn] could not build optimal variables_hash, you should increase either variables_hash_max_size: 1024 or variables_hash_bucket_size: 64; ignoring variables_hash_bucket_size
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

How can I figure out what is causing my nginx to fail at boot every time but be totally fine if I restart it?

systemctl status nginx -n 30 before restarting it

user@server:~ $ sudo yunohost service status nginx && sudo yunohost service status postfix
configuration: valid
description: Serves or provides access to all the websites hosted on your server
last_state_change: 2023-03-28 15:27:36
start_on_boot: enabled
status: failed
configuration: unknown
description: Used to send and receive e-mails
last_state_change: 2023-03-28 15:29:42
start_on_boot: enabled
status: failed
user@server:~ $ sudo systemctl status nginx -n 30 && sudo systemctl restart nginx
● 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: timeout) since Tue 2023-03-28 15:27:36 PDT; 8min ago
       Docs: man:nginx(8)
    Process: 1004 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=killed, signal=TERM)
        CPU: 1.487s

Mar 28 15:26:06 my.server.io systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 28 15:27:19 my.server.io nginx[1004]: nginx: [warn] could not build optimal variables_hash, you should increase >
Mar 28 15:27:36 my.server.io systemd[1]: nginx.service: start-pre operation timed out. Terminating.
Mar 28 15:27:36 my.server.io systemd[1]: nginx.service: Control process exited, code=killed, status=15/TERM
Mar 28 15:27:36 my.server.io systemd[1]: nginx.service: Failed with result 'timeout'.
Mar 28 15:27:36 my.server.io systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Mar 28 15:27:36 my.server.io systemd[1]: nginx.service: Consumed 1.487s CPU time.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.