fail2ban nextcloud won't start

After configured fail2ban for nextcloud i’m getting this errors

systemctl status fail2ban.service

root@DietPi:~# systemctl status fail2ban.service
● fail2ban.service - Fail2Ban Service
   Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor preset:
 enabled)
   Active: failed (Result: exit-code) since Wed 2020-11-04 13:19:46 C
ET; 22s ago
     Docs: man:fail2ban(1)
  Process: 4587 ExecStartPre=/bin/mkdir -p /var/run/fail2ban (code=exited, statu
s=0/SUCCESS)
  Process: 4588 ExecStart=/usr/bin/fail2ban-server -xf start (code=exite
d, status=255/EXCEPTION)
 Main PID: 4588 (code=exited, status=255/EXCEPTION)

Nov 04 13:19:46 DietPi systemd[1]: Starting Fail2Ban Service...
Nov 04 13:19:46 DietPi systemd[1]: Started Fail2Ban Service.
Nov 04 13:19:46 DietPi fail2ban-server[4588]:  Failed during configuration: Bad
value substitution: option 'action' in section 'nextcloud' contains an interpola
tion key 'action_mw1' which is not a valid option name. Raw value: '%(action_mw1
)s'
Nov 04 13:19:46 DietPi fail2ban-server[4588]:  Async configuration of server fai
led
Nov 04 13:19:46 DietPi systemd[1]: fail2ban.service: Mai
n process exited, code=exited, status=255/EXCEPTION
Nov 04 13:19:46 DietPi systemd[1]: fail2ban.service: Fai
led with result 'exit-code'.

nano /etc/fail2ban/jail.conf

[nextcloud]
enabled = true
port = 80,443
protocol = tcp
filter = nextcloud
maxretry = 3
logpath = /var/log/nextcloud.log
action = %(action_mwl)s

Hi,

looks like the action you have set is not accepted. Where did you get the config from?

value substitution: option 'action' in section 'nextcloud' contains an interpola
tion key 'action_mw1' which is not a valid option name. Raw value: '%(action_mw1
)s'

copied it from here
https://www.ksite.de/nextcloud-mit-fail2ban-absichern/

probably a typo. It should be

action = %(action_mwl)s

With L like Lima.

On you error message it looks like a 1 (one)

i tried it several times,
only if comment out action , failban runs

[nextcloud]
enabled = true
port = 80,443
protocol = tcp
filter = nextcloud
maxretry = 3
logpath = /var/log/nextcloud.log
#action = %(action_mwl)s

fail2ban-client status

Status
|- Number of jail:	3
`- Jail list:	dropbear, nextcloud, sshd

Maybe a problem of Nextcloud > 16 ?

well your problem is the line action = %(action_mwl)s within your jail.conf file. Best to my knowledge, this is to send email notification. https://wiki.archlinux.org/index.php/fail2ban#Receive_an_alert_e-mail

But I guess this is not configured on your F2B installation. Found another guide how to setup F2B and Nextcloud https://www.allerstorfer.at/fail2ban-fuer-nextcloud/

Btw: nextcloud.log is located at /mnt/dietpi_userdata/nextcloud_data/nextcloud.log by default.