Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BR]: installing fail2ban on ubuntu 24.04 with apt-get showing errors and is not starting #3754

Closed
1 task
Shaggy0815 opened this issue Jun 4, 2024 · 2 comments

Comments

@Shaggy0815
Copy link

I have just setup a fresh install completly updated ubuntu 24.04. when installing fail2ban it is showing several warnings

Environment:

  • Fail2Ban version :
  • OS, including release name/version :
  • [ X] Fail2Ban installed via OS/distribution mechanisms
  • [ X] You have not applied any additional foreign patches to the codebase
  • Some customizations were done to the configuration (provide details below is so)

The issue:

root@ubuntu:~# apt install fail2ban -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
mailx monit sqlite3
The following NEW packages will be installed:
fail2ban
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 490 kB of archives.
After this operation, 2125 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble/universe amd64 fail2ban all 1.0.2-3 [490 kB]
Fetched 490 kB in 1s (612 kB/s)
Selecting previously unselected package fail2ban.
(Reading database ... 67026 files and directories currently installed.)
Preparing to unpack .../fail2ban_1.0.2-3_all.deb ...
Unpacking fail2ban (1.0.2-3) ...
Setting up fail2ban (1.0.2-3) ...
/usr/lib/python3/dist-packages/fail2ban/tests/fail2banregextestcase.py:224: SyntaxWarning: invalid escape sequence '\s'
"1490349000 test failed.dns.ch", "^\stest \S+"
/usr/lib/python3/dist-packages/fail2ban/tests/fail2banregextestcase.py:435: SyntaxWarning: invalid escape sequence '\S'
'^'+prefix+'User \S+ not allowed\n'
/usr/lib/python3/dist-packages/fail2ban/tests/fail2banregextestcase.py:443: SyntaxWarning: invalid escape sequence '\S'
'^'+prefix+'User \S+ not allowed\n'
/usr/lib/python3/dist-packages/fail2ban/tests/fail2banregextestcase.py:444: SyntaxWarning: invalid escape sequence '\d'
'^'+prefix+'Received disconnect from port \d+'
/usr/lib/python3/dist-packages/fail2ban/tests/fail2banregextestcase.py:451: SyntaxWarning: invalid escape sequence '\s'
_test_variants('common', prefix="\s
\S+ sshd[\d+]:\s+")
/usr/lib/python3/dist-packages/fail2ban/tests/fail2banregextestcase.py:537: SyntaxWarning: invalid escape sequence '['
'common[prefregex="^svc[\d+] connect .+$"'
/usr/lib/python3/dist-packages/fail2ban/tests/servertestcase.py:1375: SyntaxWarning: invalid escape sequence '\s'
"{ nft -a list chain inet f2b-table f2b-chain | grep -oP '@addr-set-j-w-nft-mp\s+.*\s+\Khandle\s+(\d+)$'; } | while read -r hdl; do",
/usr/lib/python3/dist-packages/fail2ban/tests/servertestcase.py:1378: SyntaxWarning: invalid escape sequence '\s'
"{ nft -a list chain inet f2b-table f2b-chain | grep -oP '@addr6-set-j-w-nft-mp\s+.*\s+\Khandle\s+(\d+)$'; } | while read -r hdl; do",
/usr/lib/python3/dist-packages/fail2ban/tests/servertestcase.py:1421: SyntaxWarning: invalid escape sequence '\s'
"{ nft -a list chain inet f2b-table f2b-chain | grep -oP '@addr-set-j-w-nft-ap\s+.*\s+\Khandle\s+(\d+)$'; } | while read -r hdl; do",
/usr/lib/python3/dist-packages/fail2ban/tests/servertestcase.py:1424: SyntaxWarning: invalid escape sequence '\s'
"{ nft -a list chain inet f2b-table f2b-chain | grep -oP '@addr6-set-j-w-nft-ap\s+.*\s+\Khandle\s+(\d+)$'; } | while read -r hdl; do",
Processing triggers for man-db (2.12.0-4build2) ...
Scanning processes...
Scanning linux images...

Running kernel seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@ubuntu:# uname -a
Linux ubuntu 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
root@ubuntu:
#

oot@ubuntu:~# systemctl status fail2ban
× fail2ban.service - Fail2Ban Service
Loaded: loaded (/usr/lib/systemd/system/fail2ban.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Tue 2024-06-04 08:07:08 UTC; 6min ago
Duration: 274ms
Docs: man:fail2ban(1)
Process: 1564 ExecStart=/usr/bin/fail2ban-server -xf start (code=exited, status=255/EXCEPTION)
Main PID: 1564 (code=exited, status=255/EXCEPTION)
CPU: 145ms

Jun 04 08:07:08 ubuntu systemd[1]: Started fail2ban.service - Fail2Ban Service.
Jun 04 08:07:08 ubuntu fail2ban-server[1564]: 2024-06-04 08:07:08,696 fail2ban.configreader [1564]: WARNING 'allowipv6' not defined in 'Definition'. Using default o>
Jun 04 08:07:08 ubuntu fail2ban-server[1564]: 2024-06-04 08:07:08,764 fail2ban [1564]: ERROR No module named 'asynchat'
Jun 04 08:07:08 ubuntu systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
Jun 04 08:07:08 ubuntu systemd[1]: fail2ban.service: Failed with result 'exit-code'.
lines 1-14/14 (END)

Steps to reproduce

new installed ubuntu 24.04 update and upgrade done.
apt-get install fail2ban -y

systemctl status fail2ban

Expected behavior

working fail2ban

Observed behavior

not working fail2ban

Any additional information

@Shaggy0815 Shaggy0815 added the bug label Jun 4, 2024
@Shaggy0815 Shaggy0815 changed the title [BR]: installing fail2ban on ubuntu 24.04 with apt-get showing errors [BR]: installing fail2ban on ubuntu 24.04 with apt-get showing errors and is not starting Jun 4, 2024
@Shaggy0815
Copy link
Author

to get fail2ban starting the following is working:
apt-get install python3-pip
python3 -m pip install pyasynchat --break-system-packages
systemctl start fail2ban

@sebres
Copy link
Contributor

sebres commented Jun 4, 2024

Dup of #3487.
Already fixed and released (here).
We're not responsible for Ubuntu distribution.

@sebres sebres closed this as completed Jun 4, 2024
glillico added a commit to glillico/ansible-role-install_fail2ban that referenced this issue Jun 6, 2024
glillico added a commit to glillico/ansible-role-install_fail2ban that referenced this issue Jun 11, 2024
glillico added a commit to glillico/ansible-role-install_fail2ban that referenced this issue Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants