Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gentoo-user] fail2ban can't find sqlite?

73 views
Skip to first unread message

Dan Egli

unread,
Feb 6, 2021, 8:50:03 PM2/6/21
to
I am trying to figure this one out. I need some help as apparently my
google-fu isn't strong today. I installed faii2ban so I could use it to
monitor the logs and adjust the firewall as necessary. It installed
okay, and seems to run okay EXCEPT for this one error I get each time I
start fail2ban-server:
2021-02-06 18:30:28,128 fail2ban.server         [32124]: ERROR Unable to
import fail2ban database module as sqlite is not available.

At first I thought it was complaining about it's own missing module. But
there's no use flag for sqlite in fail2ban. So then I looked at python
itself.  Sure enough, the sqlite use flag was disabled. So I turned it
on and re-emerged python. I also fixed a couple flags on sqlite itself
and re-emerged it. STILL I get this error. How do I fix this?

Michael Orlitzky

unread,
Feb 6, 2021, 9:10:03 PM2/6/21
to
On Sat, 2021-02-06 at 18:46 -0700, Dan Egli wrote:
>
> At first I thought it was complaining about it's own missing module. But
> there's no use flag for sqlite in fail2ban. So then I looked at python
> itself. Sure enough, the sqlite use flag was disabled. So I turned it
> on and re-emerged python. I also fixed a couple flags on sqlite itself
> and re-emerged it. STILL I get this error. How do I fix this?
>

Just a guess: did you rebuild EVERY version of python, or just one? It
could be that fail2ban is running under a version that you didn't re-
emerge.

Alexey Mishustin

unread,
Feb 6, 2021, 9:10:04 PM2/6/21
to
вс, 7 февр. 2021 г. в 04:47, Dan Egli <d...@newideatest.site>:

Hi Dan,

> 2021-02-06 18:30:28,128 fail2ban.server [32124]: ERROR Unable to
> import fail2ban database module as sqlite is not available.

Some debugging from
https://github.com/fail2ban/fail2ban/issues/2608#issuecomment-576450793
:

fail2ban-python --version
fail2ban-python -c 'import sqlite3; print("ok")'
fail2ban-python -c 'from fail2ban.server.database import Fail2BanDb;
print("ok")'

--
Best regards,
Alex

Dan Egli

unread,
Feb 7, 2021, 8:40:03 PM2/7/21
to
You were right. With the debugging tips from Alex Mishustin I was able
to determine that I had rebuilt 3.9 while fail2ban was using 3.8. I did
what I SHOULD have done in the first place and did an emerge -DN
fail2ban. That caused portage to see that Python 3.8 needed to be
rebuilt, and it did so. Now fail2ban is able to access the sqlite database.

Thanks!
0 new messages