Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 543348

Summary: net-analyzer/fail2ban-0.9.1 - ERROR Unable to import fail2ban database module as sqlite is not available
Product: Gentoo Linux Reporter: yves.caniou
Component: Current packagesAssignee: Gentoo Netmon project <netmon>
Status: RESOLVED FIXED    
Severity: normal CC: holy.smoking.floorboards.batman, xman00, yves.caniou
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 548642    
Bug Blocks:    
Attachments: emerge--info

Description yves.caniou 2015-03-14 18:11:11 UTC
Created attachment 398914 [details]
emerge--info

Launching fail2ban gives the message
ERROR   Unable to import fail2ban database module as sqlite is not available.
in /var/log/fail2ban.log

Got dev-lang/python-2.7.9-r1 installed with +sqlite to get www-client/firefox-31.4.0 installed, but fail2ban is launched with /usr/bin/python3.3, which hasn't this flag set.

=> fail2ban should force +sqlite to python to get installed.

Cheers.

.Y
Comment 1 yves.caniou 2015-03-14 18:51:41 UTC
In /etc/portage/packages.use[/monolithic]
using
>=dev-lang/python-2.7.9-r1 sqlite
instead of =dev-lang/python-2.7.9-r1 sqlite
that was placed to get Firefox compiled, and recompiling makes fail2ban working with a
"INFO    Connected to fail2ban persistent database '/var/lib/fail2ban/fail2ban.sqlite3'" in /var/log/fail2ban.conf
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2015-03-16 16:53:09 UTC
Your emerge output should have included a warning about dev-lang/python not having been compiled with USE=sqlite.
Comment 3 yves.caniou 2015-03-16 16:58:11 UTC
If you say so, yes. But then, during the install process, among all the logs.
Not at the very end, I would have seen that.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2015-03-19 18:38:57 UTC
Maybe it ought to say "WARNING" where it says "ERROR".
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2015-04-30 20:53:57 UTC
This should be fixed in 0.9.2. Please test.
Comment 6 Horst Prote 2015-08-14 09:29:06 UTC
(In reply to Jeroen Roovers from comment #2)
> Your emerge output should have included a warning about dev-lang/python not
> having been compiled with USE=sqlite.

I just installed fail2ban-0.9.2 and didn't get any of the warnings about dev-python/pyinotify, app-admin/gamin or dev-lang/python[sqlite] from the pkg_postinst() function. This is caused by the enclosing

  if ! has_version ${CATEGORY}/${PN}; then ... fi

As this is called POST installation the version ${PN} IS installed and so the condition is never true.
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2017-01-24 05:42:42 UTC
*** Bug 606974 has been marked as a duplicate of this bug. ***
Comment 8 Romain Riviere 2017-12-16 11:07:08 UTC
(In reply to Jeroen Roovers from comment #5)
> This should be fixed in 0.9.2. Please test.

Would you please consider reopening this bug? The problem is still present in 0.9.6. Because it is an error and not a warning, fail2ban does not stop or restart cleanly. There should be at least some dependency on sqlite or USE +sqlite, or a "downgrade" of the error to a simple warning.