Articles in this section

Fail2ban does not start on a Plesk server with Ubuntu 24: No module named 'asynchat'

Plesk for Linux kb: technical

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:

  1. Connect to the server via SSH

  2. Install PIP (Package Installer for Python):

    # apt install python3-pip

  3. Install pyasynchat package:

    # python3 -m pip install pyasynchat --break-system-packages

  4. Start Fail2ban service

    # systemctl start fail2ban

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.