Fail2ban fails to start

Hi,

Matériel : Olimex A20, lime2. image Debian buster
Version de YunoHost : 4.0.8.3 (stable) derrière freebox mini 4K
J’ai accès à mon serveur : En SSH | Par la webadmin
Êtes-vous dans un contexte particulier ou avez-vous effectué des modificiations particulières sur votre instance ? : non

I’m having an issue with fail2ban that fails to start on my instance. I know it’s related to Nextcloud but not sure about how to solve this. Here is the log:

– Logs begin at Wed 2021-02-17 15:17:01 GMT, end at Thu 2021-02-18 11:45:08 GMT. –
Feb 17 15:17:19 systemd[1]: Starting Fail2Ban Service…
Feb 17 15:17:19 systemd[1]: Started Fail2Ban Service.
Feb 17 15:17:21 fail2ban-server[774]: No file(s) found for glob /home/yunohost.app/nextcloud/data/nextcloud.log
Feb 17 15:17:21 fail2ban-server[774]: Failed during configuration: Have not found any log file for nextcloud jail
Feb 17 15:17:21 fail2ban-server[774]: Async configuration of server failed
Feb 17 15:17:21 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
Feb 17 15:17:21 systemd[1]: fail2ban.service: Failed with result ‘exit-code’.
Feb 17 15:17:25 systemd[1]: fail2ban.service: Unit cannot be reloaded because it is inactive.
Feb 17 15:33:41 systemd[1]: /lib/systemd/system/fail2ban.service:12: PIDFile= references path below legacy directory /var/run/, updating /var/run/fail2ban/fail2ban.pid → /run/fail2ban/fail2ban.pid; please update the unit file accordingly.
Feb 17 15:33:42 systemd[1]: /lib/systemd/system/fail2ban.service:12: PIDFile= references path below legacy directory /var/run/, updating /var/run/fail2ban/fail2ban.pid → /run/fail2ban/fail2ban.pid; please update the unit file accordingly.
Feb 17 15:33:44 systemd[1]: /lib/systemd/system/fail2ban.service:12: PIDFile= references path below legacy directory /var/run/, updating /var/run/fail2ban/fail2ban.pid → /run/fail2ban/fail2ban.pid; please update the unit file accordingly.
Feb 17 15:33:45 systemd[1]: /lib/systemd/system/fail2ban.service:12: PIDFile= references path below legacy directory /var/run/, updating /var/run/fail2ban/fail2ban.pid → /run/fail2ban/fail2ban.pid; please update the unit file accordingly.
Feb 17 15:37:47 systemd[1]: Starting Fail2Ban Service…
Feb 17 15:37:47 systemd[1]: Started Fail2Ban Service.
Feb 17 15:37:47 fail2ban-server[4084]: No file(s) found for glob /home/yunohost.app/nextcloud/data/nextcloud.log
Feb 17 15:37:47 fail2ban-server[4084]: Failed during configuration: Have not found any log file for nextcloud jail
Feb 17 15:37:47 fail2ban-server[4084]: Async configuration of server failed
Feb 17 15:37:47 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
Feb 17 15:37:47 systemd[1]: fail2ban.service: Failed with result ‘exit-code’.
Feb 18 11:44:58 systemd[1]: Starting Fail2Ban Service…
Feb 18 11:44:58 systemd[1]: Started Fail2Ban Service.
Feb 18 11:44:58 fail2ban-server[27204]: No file(s) found for glob /home/yunohost.app/nextcloud/data/nextcloud.log
Feb 18 11:44:58 fail2ban-server[27204]: Failed during configuration: Have not found any log file for nextcloud jail
Feb 18 11:44:58 fail2ban-server[27204]: Async configuration of server failed
Feb 18 11:44:58 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
Feb 18 11:44:58 systemd[1]: fail2ban.service: Failed with result ‘exit-code’.

Thanks for your help!

Hmpf let’s try this:

touch /home/yunohost.app/nextcloud/data/nextcloud.log

But it would help if you could elaborate on when this started to happen with respect to the nextcloud install (was it just after installing nextcloud ? or nextcloud was working fine since a while and this spontanouesly happened ? did you do anything particular related to /home/yunohost.app ?)

1 Like

touch: cannot touch '/home/yunohost.app/nextcloud/data/nextcloud.log': No such file or directory

I kind of messed up different things on my Nextcloud install before this. Here we go :confused:

  • I changed nextcloud’s storage to a external ssd drive (Déplacement données Nextcloud sur disque externe : erreur au scan du nouveau répertoire). It went OK.

  • Then I had an unexpected Errror 504 “bad gateway” when trying to reach the Nextcloud URL. I figured out that it was related to a failed OnlyOffice install (OnlyOffice fails to install). I manually deleted the OnlyOffice folder in in /var/www/nextcloud/apps (this might be the biggest mistake I did…), but then my Freebox died and everything was offline for a few days !

  • I received the new Freebox yesterday, and restarted my Pi Yunohost server. Now I can reach Nextcloud, sync works fine, everything’s OK, fail2ban failing to start is the last error I see.

Wokay then, naively I would say this could be related to the move to another hard drive, and maybe your drive ain’t properly mounted right now ?

Have you created a symlink at some point between /home/yunohost.app (or similar) and the hard drive …?

Not sure, but here is the lsblk output:

NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0  477G  0 disk
└─sda1        8:1    0  477G  0 part /media/stockage
mmcblk0     179:0    0 59.5G  0 disk
├─mmcblk0p1 179:1    0  256M  0 part /boot
└─mmcblk0p2 179:2    0 59.2G  0 part /

The sda drive mounts automatically thanks to the tutorial from Yunohost doc…

Hmokay, what about:

ls -l /home/yunohost.app
ls -l /home/yunohost.app/nextcloud
ls -l /home/yunohost.app/nextcloud/data
drwxr-xr-x 2 root       root       4096 Feb  7 17:33 nextcloud
drwx------ 7 gitlab-www gitlab-www 4096 Jan 13 14:58 seafile-data
total 0
ls: cannot access '/home/yunohost.app/nextcloud/data': No such file or directory

Alors quid de:

ls -ld /home/
ls -ld /home/yunohost.app
ls -l /media/stockage

(j’essaye de trouver où est le lien entre ton disque dur et ton home…)

1 Like
drwxr-xr-x 11 root root 4096 Jan 21 23:44 /home/
drwxr-xr-x 4 root root 4096 Jan 13 14:57 /home/yunohost.app/
total 20
drwx------ 2 root      root 16384 Feb  6 13:09 lost+found
drwxrwx--- 4 nextcloud root  4096 Feb  7 15:31 nextcloud_data

Beh du coup je ne sais pas comment tu as configuré les choses mais il ne semble pas y’avoir de pont entre ton dossier /home/yunohost.app/nextcloud/data (qui n’existe pas) et /media/stockage/nextcloud_data

Donc naivement je ferais un

ln -s /media/stockage/nextcloud_data /home/yunohost.app/nextcloud/data
1 Like

Yep ça fonctionne ! Merci !

Bon du coup je vais l’ajouter à la doc de déplacement des données Nextcloud vers disque externe non ?

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