Fail2Ban fails to launch even after launching through `yunohost service start fail2ban`

My YunoHost server

Hardware: VPS bought online
YunoHost version: 11.2.10.3
I have access to my server : Through SSH
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : nothing comes to mind.

Description of my issue

To get help efficiently, please explain what you are trying to achieve, in which context, what you tried and provide detailed error messages and logs if you can.

I am trying to achieve Fail2Ban working as without Fail2Ban the server refuses to to allow for application management.

I have already found that this is a known bug with Fail2Ban and is updated in v1.0.2 however, bullseye’s repos only has version 0.11.2-2

Mar 22 08:20:45 systemd[1]: Starting fail2ban.service - Fail2Ban Service...
Mar 22 08:20:45 systemd[1]: Started fail2ban.service - Fail2Ban Service.
Mar 22 08:20:49 fail2ban-server[658]: ERROR: cannot import name 'MutableMapping' from 'collections' (/usr/lib/python3.11/collections/__init__.py)
Mar 22 08:20:49 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
Mar 22 08:20:49 systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Mar 22 08:20:58 systemd[1]: Starting fail2ban.service - Fail2Ban Service...
Mar 22 08:20:59 systemd[1]: Started fail2ban.service - Fail2Ban Service.
Mar 22 08:21:01 fail2ban-server[1253]: ERROR: cannot import name 'MutableMapping' from 'collections' (/usr/lib/python3.11/collections/__init__.py)
Mar 22 08:21:01 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
Mar 22 08:21:01 systemd[1]: fail2ban.service: Failed with result 'exit-code'.

This part is concerning: /usr/lib/python3.11/ Thing is bullseye only ships Python 3.9, why is fail2ban asking for 3.11? Did you enable backports repo by any chance?

No, the backports sub-branch isn’t enabled but I do have 3.11.8 installed…

Is there a way to roll back Python without it breaking absolutely everything?

But how did you even managed to do that? It’s installed from deb? What fail2ban version do you have installed anyway?

Imma be 100% honest and say I actually have no clue how I managed to pull this off… Honestly though, my first mistake was running this on a prod server >_>

Version of Fail2Ban is v0.11.2

To be clear, what’s the output of python3 --version? What’s the output of which python3?

Python 3.11.8

/usr/bin/python3

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