Problème avec Fail2Ban et Nextcloud

Bonjour à tous !

Hello everyone,

My YunoHost server

Hardware: Serveur (at my parent’s place)
YunoHost version: 11.2.30
I have access to my server : Through SSH 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

I hope you’re all well. I come because I have an issue with my Yunohost installation. I try to update nextcloud from my admin panel but I can’t because I have an error: fail2ban is failed. I must start this service before going futher.
I’ve tried to look for some topics about this but I couldn’t find something…
Otherwise everything is working properly.
If anyone as a idea :slight_smile:
Thank you

Here are the logs from my admin panel ctl (tools, service, fail2ban)

sept. 06 13:09:06 systemd[1]: Starting Fail2Ban Service...
sept. 06 13:09:07 systemd[1]: Started Fail2Ban Service.
sept. 06 13:09:07 fail2ban-server[1842468]: 2024-09-06 13:09:07,134 fail2ban                [1842468]: ERROR   Failed during configuration: Have not found any log file for nextcloud jail
sept. 06 13:09:07 fail2ban-server[1842468]: 2024-09-06 13:09:07,135 fail2ban                [1842468]: ERROR   Async configuration of server failed
sept. 06 13:09:07 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
sept. 06 13:09:07 systemd[1]: fail2ban.service: Failed with result 'exit-code'.

Here are the logs from fail2ban.logs

2023-05-24 17:30:45,305 fail2ban.utils          [608]: ERROR   7f4f8c44d350 -- stderr: 'iptables: No chain/target/match by that name.'
2023-05-24 17:30:45,305 fail2ban.utils          [608]: ERROR   7f4f8c44d350 -- returned 1
2023-05-24 17:30:45,305 fail2ban.actions        [608]: ERROR   Failed to flush bans in jail 'sshd' action 'iptables-multiport': Error flushing action Jail('sshd')/iptables-multiport: 'Script error'
2023-05-24 17:30:45,305 fail2ban.actions        [608]: INFO    No flush occurred, do consistency check
2023-05-24 17:30:45,311 fail2ban.utils          [608]: ERROR   7f4f8e5db7a0 -- exec: iptables -w -n -L INPUT | grep -q 'f2b-sshd[ \t]'
2023-05-24 17:30:45,311 fail2ban.utils          [608]: ERROR   7f4f8e5db7a0 -- returned 1
2023-05-24 17:30:45,311 fail2ban                [608]: CRITICAL Unhandled exception in Fail2Ban:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 653, in __flushBan
    if action.flush():
  File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 637, in flush
    return self._executeOperation('<actionflush>', 'flushing', family=family, afterExec=_afterFlush)
  File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 476, in _executeOperation
    raise RuntimeError("Error %s action %s/%s: %r" % (operation, self._jail, self._name, err))
RuntimeError: Error flushing action Jail('sshd')/iptables-multiport: 'Script error'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/fail2ban/server/jailthread.py", line 69, in run_with_except_hook
    run(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 368, in run
    self.__flushBan(stop=True)
  File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 666, in __flushBan
    action.consistencyCheck(_beforeRepair)
  File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 690, in consistencyCheck
    if started and not self._invariantCheck(family, beforeRepair):
  File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 916, in _invariantCheck
    if beforeRepair and not beforeRepair():
  File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 663, in _beforeRepair
    self._logSys.error("Invariant check failed. Flush is impossible.")
AttributeError: 'Actions' object has no attribute '_logSys'
2023-05-24 17:30:45,313 fail2ban.jail           [608]: INFO    Jail 'sshd' stopped
2023-05-24 17:30:45,535 fail2ban.actions        [608]: NOTICE  [sasl] Flush ticket(s) with iptables-multiport
2023-05-24 17:30:45,537 fail2ban.actions        [608]: NOTICE  [nextcloud] Flush ticket(s) with iptables-multiport
2023-05-24 17:30:45,736 fail2ban.actions        [608]: NOTICE  [nginx-http-auth] Flush ticket(s) with iptables-multiport
2023-05-24 17:30:45,737 fail2ban.jail           [608]: INFO    Jail 'nginx-http-auth' stopped
2023-05-24 17:30:45,737 fail2ban.actions        [608]: NOTICE  [recidive] Flush ticket(s) with iptables-allports
2023-05-24 17:30:45,738 fail2ban.actions        [608]: NOTICE  [postfix] Flush ticket(s) with iptables-multiport
2023-05-24 17:30:45,738 fail2ban.actions        [608]: NOTICE  [dovecot] Flush ticket(s) with iptables-multiport
2023-05-24 17:30:45,739 fail2ban.jail           [608]: INFO    Jail 'postfix' stopped
2023-05-24 17:30:45,740 fail2ban.jail           [608]: INFO    Jail 'dovecot' stopped
2023-05-24 17:30:45,740 fail2ban.jail           [608]: INFO    Jail 'recidive' stopped
2023-05-24 17:30:45,741 fail2ban.actions        [608]: NOTICE  [yunohost] Flush ticket(s) with iptables-multiport
2023-05-24 17:30:45,741 fail2ban.jail           [608]: INFO    Jail 'pam-generic' stopped
2023-05-24 17:30:45,742 fail2ban.jail           [608]: INFO    Jail 'yunohost' stopped
2023-05-24 17:30:45,742 fail2ban.jail           [608]: INFO    Jail 'sasl' stopped
2023-05-24 17:30:45,743 fail2ban.jail           [608]: INFO    Jail 'nextcloud' stopped
2023-05-24 17:30:45,744 fail2ban.database       [608]: INFO    Connection to database closed.
2023-05-24 17:30:45,744 fail2ban.server         [608]: INFO    Exiting Fail2ban

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