Ubuntu

Fail2Ban has some incompatibilities with Python 2.6. So, it should use Python 2.5

Reported by Anderson on 2009-05-05
40
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Gentoo Linux
Fix Released
Medium
fail2ban (Fedora)
Fix Released
Unknown
fail2ban (Ubuntu)
Medium
Chris Coulson
fail2ban (openSUSE)
Fix Released
Medium

Bug Description

Binary package hint: fail2ban

After upgrading all my Ubuntu servers from Intrepid to Jaunty, Fail2Ban log files begun showing strange messages:

2009-05-05 03:34:26,742 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,743 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,745 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,762 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,764 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,765 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,767 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,768 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,770 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,771 fail2ban.jail : INFO Creating new jail 'sshd-ddos'
2009-05-05 03:34:26,771 fail2ban.jail : INFO Jail 'sshd-ddos' uses poller
2009-05-05 03:34:26,772 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,773 fail2ban.filter : INFO Added logfile = /var/log/auth.log
2009-05-05 03:34:26,775 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,775 fail2ban.filter : INFO Set maxRetry = 5
2009-05-05 03:34:26,776 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,811 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,822 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,823 fail2ban.filter : INFO Set findtime = 300
2009-05-05 03:34:26,826 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,828 fail2ban.actions: INFO Set banTime = 86400
2009-05-05 03:34:26,831 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,834 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,848 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,849 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,851 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,854 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,857 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,860 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,874 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,876 fail2ban.server : ERROR Unexpected communication error
2009-05-05 03:34:26,877 fail2ban.server : ERROR Unexpected communication error

I didn't investigated so much... Instead, I looked for a solution at Google. I found it at:
http://forum.ubuntu-fr.org/viewtopic.php?id=313098

After installing Python 2.5 and applying the proposed fix, those strange messages disappear.

So... Could Fail2Ban package in Ubuntu Jaunty have /usr/bin/python2.5 as interpreter? Could Fail2Ban package request installing Python 2.5 also?

Related branches

the_arm (armccabe) wrote :

Hi there - new around here, so I don't know if "me too"-type comments are appreciated or not.

I upgraded from Intrepid->Jaunty this weekend and experienced the exact same issue as described above, including the "Unexpected communication error"; there was nothing in the logfile to indicate that fail2ban was actually functioning. No one had been banned.

Switched the first line as suggested in the link, restarted it, and no more "Unexpected Communication Errors". Furthermore, my logfile indicates that there has already been multiple bans, as expected.

cheers,
arm

yamo (stephane-gregoire) wrote :

Hi, I had this bug and I found a trick to solve it on the french forum :

http://forum.ubuntu-fr.org/viewtopic.php?pid=2605566#p2605566

User-Agent: Mozilla/5.0 (compatible; Konqueror/4.1; Linux) KHTML/4.1.3 (like Gecko) SUSE

Fail2ban does not work with python2.6
Syslog shows
fail2ban.server : ERROR Unexpected communication error
Google search showed the need of python2.5 which is not available with OpenSuse11.1
See for example:
http://www.howtoforge.com/forums/showthread.php?t=34886

Reproducible: Always

Steps to Reproduce:
1. install fail2ban
2. enable sshd-jail
3. start fail2ban
4. check /var/log/messages
5. fail2ban is not blocking a bruteforce attack

Changed in fail2ban (Fedora):
status: Unknown → In Progress
Changed in fail2ban (openSUSE):
status: Unknown → Confirmed
Changed in gentoo:
status: Unknown → Confirmed

Seems I've fixed it. Check the latest nightly build for branches/FAIL2BAN-0.8 from: http://www.fail2ban.org/nightly/

Or use this direct link:
http://www.fail2ban.org/nightly/fail2ban-FAIL2BAN-0_8.tar.bz2

Yours,
Buanzo.

Changed in fail2ban (Fedora):
status: In Progress → Fix Released
Cyril Jaquier (cyril-jaquier) wrote :

Hi all,

We just released 0.8.4 which works with python 2.6. You can get it here:

http://downloads.sourceforge.net/fail2ban/fail2ban-0.8.4.tar.bz2

Regards,
Cyril

ScottMiller (stmiller) wrote :

Current Ubuntu 9.10 karmic still has the older release, and errors persist. :-/

Package: fail2ban (0.8.3-6ubuntu1) [universe]

Is any update possible before the official release?

Chris Coulson (chrisccoulson) wrote :

As we are in feature freeze, updating the package to 0.8.4 will require a feature freeze exception, using the procedure outlined at https://wiki.ubuntu.com/FreezeExceptionProcess . However, I can cherry pick the upstream change which fixes this issue for now without doing that.

Changed in fail2ban (Ubuntu):
assignee: nobody → Chris Coulson (chrisccoulson)
importance: Undecided → Medium
status: New → In Progress
Chris Coulson (chrisccoulson) wrote :

Uploaded a fix now

Changed in fail2ban (Ubuntu):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package fail2ban - 0.8.3-6ubuntu2

---------------
fail2ban (0.8.3-6ubuntu2) karmic; urgency=low

  * server/asyncserver.py:
    - Applied upstream SVN revisions 735-738 to fix a Python
      2.6 / 3.0 incompatibility (LP: #372304).

 -- Chris Coulson <email address hidden> Thu, 17 Sep 2009 00:17:28 +0100

Changed in fail2ban (Ubuntu):
status: Fix Committed → Fix Released

feel free to do a submit request against factory

Please note that fail2ban 0.8.4 is available on Factory since some weeks.

good enough for me, thanks

Changed in fail2ban (openSUSE):
status: Confirmed → Fix Released
Changed in gentoo:
status: Confirmed → Fix Released
Changed in gentoo:
importance: Unknown → Medium
Changed in fail2ban (openSUSE):
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.