Symptoms
-
On a brand-new install of Plesk for Linux on an Ubuntu 24.04 server, fail2ban service does not start.
-
The following information can be seen on
systemctl status fail2ban
CONFIG_TEXT: May 17 15:32:25 server.example.com systemd[1]: Starting fail2ban.service - Fail2Ban Service...
May 17 15:32:25 server.example.com systemd[1]: Started fail2ban.service - Fail2Ban Service.
May 17 15:32:25 server.example.com fail2ban-server[128927]: 2024-05-17 15:32:25,412 fail2ban.configreader [128927]: WARNING 'allowipv6' not defined in 'Definition'.
May 17 15:32:25 server.example.com fail2ban-server[128927]: 2024-05-17 15:32:25,449 fail2ban [128927]: ERROR No module named 'asynchat'
May 17 15:32:25 server.example.com systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
May 17 15:32:25 server.example.com systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Cause
Fail2Ban is incompatible with Python 3.12 due to a known issue:
Resolution
As a workaround, install pyasynchat:
-
Connect to the server via SSH
-
Install PIP (Package Installer for Python):
# apt install python3-pip
-
Install pyasynchat package:
# python3 -m pip install pyasynchat --break-system-packages
-
Start Fail2ban service
# systemctl start fail2ban
Comments
0 comments
Please sign in to leave a comment.