Bug 255543 - security/py-fail2ban: Not working with Python 3.8
Summary: security/py-fail2ban: Not working with Python 3.8
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
Depends on:
Reported: 2021-05-02 10:27 UTC by Peter Putzer
Modified: 2021-05-02 10:57 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (theis)


Note You need to log in before you can comment on or make changes to this bug.
Description Peter Putzer 2021-05-02 10:27:33 UTC
Since the change to Python 3.8, py-fail2ban does not work. The port compiles and installs fine, but "service fail2ban start/stop/restart" results in an error 
ERROR   [[Errno 61] Connection refused] Unable to contact server. Is it running?
ERROR   Fail2ban seems to be in unexpected state (not running but the socket exists)

There seems to be a communcation problem between client and server which has also been reported upstream (though I'm not sure this is an upstream issue): https://github.com/fail2ban/fail2ban/issues/3014
Comment 1 theis 2021-05-02 10:39:33 UTC
I updated python a couple of days before. I noticed that the pid in sock files in /var/run/fail2ban are left over which in my case caused the messages "not running but socket exists" and another error "'str' object does not have property 'args'" (or something like that). Deleting those files solved my problems. I filed it as my error because I didn't followed the update procedure to its full extend and so didn't investigate further. A fresh install of fail2ban on a test machine was successful.

So you may try if this resolves your problem:
 - stop fail2ban
 - remove the /var/run/fail2ban/fail2ban.pid and .../fail2ban.sock
 - start fail2ban
Comment 2 Peter Putzer 2021-05-02 10:57:38 UTC
(In reply to theis from comment #1)

That indeed fixes the issue, thank you! 

I think there's is something wrong with the cleanup stage of the port, as I did the full "make deinstall; make clean; make install" routine when things didn't work after upgrading python according to the instructions according to UPDATING.