Yunohost installed but cannot be reached - NGINX broken

:uk:

My YunoHost server

Hardware: Internet Cube without VPN
YunoHost version: 11.2.4
I have access to my server : Through SSH

Description of my issue

Hello,

I’m installing a new yunohost instance on my ARM board (Olimex Lime 2).
Since you don’t maintain official images for ARM boards anymore (according to this post : Installation neuve sur la brique internet non fonctionnelle - #23 by jef), I’ve installed an “Bullseye” armbian image for my board (links).

I flashed the SD card via Balena, installed Armbian, then I followed I used:
curl https://install.yunohost.org | bash
as root on armbian.

Yunohost then get installed smoothly and I can access the webadmin for the post-install. Great!

But then I tried to reboot it, after finishing the post install, and the I can no longer access the webadmin. I can connect via SSH, but nothing else.

I think the nginx config is broken, but I’m a little out of my depth here and don’t know what to do next. Seems something similar to : Interface Web inaccessible - #6 by Aleks but i’m not sure it was resolved.

Here is what nginx -t gives:

nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)
2023/10/05 18:15:48 [info] 3991#3991: Using 131072KiB of shared memory for nchan in /etc/nginx/nginx.conf:61
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
2023/10/05 18:15:48 [emerg] 3991#3991: open() "/var/log/nginx/access.log" failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed

and journalctl -u nginx -n 50 --no-pager --no-hostname:

-- Journal begins at Thu 2023-10-05 13:05:23 CEST, ends at Thu 2023-10-05 18:17:01 CEST. --
Oct 05 13:17:21 systemd[1]: Starting A high performance web server and a reverse proxy server...
Oct 05 13:17:21 nginx[1002]: nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)
Oct 05 13:17:24 nginx[1002]: 2023/10/05 13:17:21 [warn] 1002#1002: "ssl_stapling" ignored, host not found in OCSP responder "r3.o.lencr.org" in the certificate "/etc/yunohost/certs/tolula.fr/crt.pem"
Oct 05 13:17:24 nginx[1002]: 2023/10/05 13:17:21 [warn] 1002#1002: "ssl_stapling" ignored, host not found in OCSP responder "r3.o.lencr.org" in the certificate "/etc/yunohost/certs/tolula.fr/crt.pem"
Oct 05 13:17:26 nginx[1002]: 2023/10/05 13:17:21 [info] 1002#1002: Using 131072KiB of shared memory for nchan in /etc/nginx/nginx.conf:61
Oct 05 13:17:27 nginx[1002]: 2023/10/05 13:17:21 [emerg] 1002#1002: open() "/var/log/nginx/access.log" failed (2: No such file or directory)
Oct 05 13:17:27 nginx[1002]: nginx: configuration file /etc/nginx/nginx.conf test failed
Oct 05 13:17:27 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Oct 05 13:17:27 systemd[1]: nginx.service: Failed with result 'exit-code'.
Oct 05 13:17:27 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
-- Boot 4a3ca23ea6e74185b522693173cde44b --
Oct 05 14:18:44 systemd[1]: Starting A high performance web server and a reverse proxy server...
Oct 05 14:18:44 nginx[1023]: nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)
Oct 05 14:18:47 nginx[1023]: 2023/10/05 14:18:44 [warn] 1023#1023: "ssl_stapling" ignored, host not found in OCSP responder "r3.o.lencr.org" in the certificate "/etc/yunohost/certs/tolula.fr/crt.pem"
Oct 05 14:18:47 nginx[1023]: 2023/10/05 14:18:44 [warn] 1023#1023: "ssl_stapling" ignored, host not found in OCSP responder "r3.o.lencr.org" in the certificate "/etc/yunohost/certs/tolula.fr/crt.pem"
Oct 05 14:18:49 nginx[1023]: 2023/10/05 14:18:44 [info] 1023#1023: Using 131072KiB of shared memory for nchan in /etc/nginx/nginx.conf:61
Oct 05 14:18:49 nginx[1023]: 2023/10/05 14:18:44 [emerg] 1023#1023: open() "/var/log/nginx/access.log" failed (2: No such file or directory)
Oct 05 14:18:49 nginx[1023]: nginx: configuration file /etc/nginx/nginx.conf test failed
Oct 05 14:18:49 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Oct 05 14:18:49 systemd[1]: nginx.service: Failed with result 'exit-code'.
Oct 05 14:18:49 systemd[1]: Failed to start A high performance web server and a reverse proxy server.

I didn’t touch anything regarding nginx, but i guess the armbian installation can be responsible ?

Thank you for your help!

Hi,
could you post the result of ls -ali /var/log/nginx?

I get:

ls: cannot access '/var/log/nginx': No such file or directory

Can you post result of ls -ali /var/log & cat /etc/fstab?

Here it is:

root@ # ls -ali /var/log & cat /etc/fstab
[1] 5325
UUID=d9fffabb-8d73-47df-998f-547df33b81a7 / ext4 defaults,noatime,commit=600,errors=remount-ro 0 1
tmpfs /tmp tmpfs defaults,nosuid 0 0

root@ total 18564
    2 drwxr-xr-x 11 root    root                4096 Oct  5 14:18 .
46081 drwxr-xr-x 14 root    root                4096 Oct  5 13:57 ..
   20 -rw-r--r--  1 root    root                7856 Oct  5 14:18 alternatives.log
   12 drwxr-xr-x  2 root    root                4096 Oct  5 14:22 apt
   21 -rw-r--r--  1 root    root              135171 Oct  5 14:19 armbian-hardware-monitor.log
   23 -rw-r-----  1 root    adm                32147 Oct  5 22:17 auth.log
   24 -rw-------  1 root    root               22194 Oct  5 14:18 boot.log
   26 -rw-r--r--  1 root    root              112945 Feb 12  2023 bootstrap.log
   28 -rw-rw----  1 root    utmp                1920 Oct  5 17:56 btmp
   13 drwxr-x---  2 _chrony _chrony             4096 Feb 18  2023 chrony
   29 -rw-r-----  1 root    adm               175263 Oct  5 22:10 daemon.log
   30 -rw-r-----  1 root    adm                 7127 Oct  5 21:19 debug
   31 -rw-r--r--  1 root    root              182192 Oct  5 14:22 dpkg.log
   32 -rw-r--r--  1 root    root                2568 Feb 12  2023 faillog
   33 -rw-r--r--  1 root    root                 774 Feb 18  2023 fontconfig.log
   52 lrwxrwxrwx  1 root    systemd-journal       20 Oct  5 14:18 journal -> /var/log.hdd/journal
   34 -rw-r-----  1 root    adm               123833 Oct  5 14:18 kern.log
   35 -rw-rw-r--  1 root    utmp            17649648 Oct  5 21:18 lastlog
   11 drwx------  2 root    root               16384 Oct  5 14:18 lost+found
   36 -rw-r-----  1 root    adm                 3123 Oct  5 19:19 mail.info
   37 -rw-r-----  1 root    adm                 3123 Oct  5 19:19 mail.log
   38 -rw-r-----  1 root    adm                  794 Oct  5 19:19 mail.warn
   39 -rw-r-----  1 root    adm               120653 Oct  5 14:18 messages
   14 drwxr-xr-x  2 root    root                4096 May 14  2021 openvpn
   40 -rw-------  1 root    root                 566 Oct  5 19:19 php7.4-fpm.log
   15 drwx------  2 root    root                4096 Feb 18  2023 private
   16 drwxr-xr-x  3 root    root                4096 Feb 12  2023 runit
   41 -rw-r-----  1 root    adm               318679 Oct  5 22:17 syslog
   17 drwxr-xr-x  2 root    root                4096 Oct  5 13:05 sysstat
   18 drwxr-xr-x  2 root    root                4096 Oct  5 13:17 unattended-upgrades
   42 -rw-rw-r--  1 root    utmp                9216 Oct  5 21:18 wtmp
   19 drwxr-x---  3 root    root                4096 Oct  5 14:18 yunohost

Does :

mkdir /var/log/nginx
touch /var/log/nginx/error.log

Fix it?

mkdir /var/log/nginx
touch /var/log/nginx/error.log

did it!

I could then yunohost service start nginx
and the webadmin was once again available! Thank you!

The diagnosis shows on the other hand other problems: fail2ban, redis-server and rspamd can not be started. Here’s the log for redis:

journalctl:
  - Journal file /var/log/journal/a1a69568ac1c4ed09dfbcf7c5e474a22/system@71b88c42112248f78fe5a411185f9e98-00000000000005e8-000606f71f02ce09.journal is truncated, ignoring file.
  - -- Journal begins at Fri 2023-10-06 00:00:17 CEST, ends at Fri 2023-10-06 09:02:06 CEST. --
  - Oct 06 09:02:03 redis-server[8488]: >>> 'logfile /var/log/redis/redis-server.log'
  - Oct 06 09:02:03 redis-server[8488]: Can't open the log file: No such file or directory
  - Oct 06 09:02:03 systemd[1]: redis-server.service: Main process exited, code=exited, status=1/FAILURE
  - Oct 06 09:02:03 systemd[1]: redis-server.service: Failed with result 'exit-code'.
  - Oct 06 09:02:03 systemd[1]: Failed to start Advanced key-value store.
  - Oct 06 09:02:04 systemd[1]: redis-server.service: Scheduled restart job, restart counter is at 1.
  - Oct 06 09:02:04 systemd[1]: Stopped Advanced key-value store.
  - Oct 06 09:02:04 systemd[1]: Starting Advanced key-value store...
  - Oct 06 09:02:04 redis-server[8500]: *** FATAL CONFIG FILE ERROR (Redis 6.0.16) ***
  - Oct 06 09:02:04 redis-server[8500]: Reading the configuration file, at line 260
  - Oct 06 09:02:04 redis-server[8500]: >>> 'logfile /var/log/redis/redis-server.log'
  - Oct 06 09:02:04 redis-server[8500]: Can't open the log file: No such file or directory
  - Oct 06 09:02:04 systemd[1]: redis-server.service: Main process exited, code=exited, status=1/FAILURE
  - Oct 06 09:02:04 systemd[1]: redis-server.service: Failed with result 'exit-code'.
  - Oct 06 09:02:04 systemd[1]: Failed to start Advanced key-value store.
  - Oct 06 09:02:04 systemd[1]: redis-server.service: Scheduled restart job, restart counter is at 2.
  - Oct 06 09:02:04 systemd[1]: Stopped Advanced key-value store.
  - Oct 06 09:02:04 systemd[1]: Starting Advanced key-value store...
  - Oct 06 09:02:05 redis-server[8511]: *** FATAL CONFIG FILE ERROR (Redis 6.0.16) ***
  - Oct 06 09:02:05 redis-server[8511]: Reading the configuration file, at line 260
  - Oct 06 09:02:05 redis-server[8511]: >>> 'logfile /var/log/redis/redis-server.log'
  - Oct 06 09:02:05 redis-server[8511]: Can't open the log file: No such file or directory
  - Oct 06 09:02:05 systemd[1]: redis-server.service: Main process exited, code=exited, status=1/FAILURE
  - Oct 06 09:02:05 systemd[1]: redis-server.service: Failed with result 'exit-code'.
  - Oct 06 09:02:05 systemd[1]: Failed to start Advanced key-value store.
  - Oct 06 09:02:05 systemd[1]: redis-server.service: Scheduled restart job, restart counter is at 3.
  - Oct 06 09:02:05 systemd[1]: Stopped Advanced key-value store.
  - Oct 06 09:02:05 systemd[1]: Starting Advanced key-value store...
  - Oct 06 09:02:05 redis-server[8524]: *** FATAL CONFIG FILE ERROR (Redis 6.0.16) ***
  - Oct 06 09:02:05 redis-server[8524]: Reading the configuration file, at line 260
  - Oct 06 09:02:05 redis-server[8524]: >>> 'logfile /var/log/redis/redis-server.log'
  - Oct 06 09:02:05 redis-server[8524]: Can't open the log file: No such file or directory
  - Oct 06 09:02:05 systemd[1]: redis-server.service: Main process exited, code=exited, status=1/FAILURE
  - Oct 06 09:02:05 systemd[1]: redis-server.service: Failed with result 'exit-code'.
  - Oct 06 09:02:05 systemd[1]: Failed to start Advanced key-value store.
  - Oct 06 09:02:06 systemd[1]: redis-server.service: Scheduled restart job, restart counter is at 4.
  - Oct 06 09:02:06 systemd[1]: Stopped Advanced key-value store.
  - Oct 06 09:02:06 systemd[1]: Starting Advanced key-value store...
  - Oct 06 09:02:06 redis-server[8533]: *** FATAL CONFIG FILE ERROR (Redis 6.0.16) ***
  - Oct 06 09:02:06 redis-server[8533]: Reading the configuration file, at line 260
  - Oct 06 09:02:06 redis-server[8533]: >>> 'logfile /var/log/redis/redis-server.log'
  - Oct 06 09:02:06 redis-server[8533]: Can't open the log file: No such file or directory
  - Oct 06 09:02:06 systemd[1]: redis-server.service: Main process exited, code=exited, status=1/FAILURE
  - Oct 06 09:02:06 systemd[1]: redis-server.service: Failed with result 'exit-code'.
  - Oct 06 09:02:06 systemd[1]: Failed to start Advanced key-value store.
  - Oct 06 09:02:06 systemd[1]: redis-server.service: Scheduled restart job, restart counter is at 5.
  - Oct 06 09:02:06 systemd[1]: Stopped Advanced key-value store.
  - Oct 06 09:02:06 systemd[1]: redis-server.service: Start request repeated too quickly.
  - Oct 06 09:02:06 systemd[1]: redis-server.service: Failed with result 'exit-code'.
  - Oct 06 09:02:06 systemd[1]: Failed to start Advanced key-value store.

EDIT : resolved thanks to Services rspamd et redis-server hors service - #13 by hibar84

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