• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Contribution Fail2Ban Database corruption - Tip and solution

trialotto

Golden Pleskian
Plesk Guru
@Everyone,

Every now and then, it can be the case that the Fail2Ban database gets corrupted.

SYMPTOMS (most common ones):

- in the Fail2Ban control panel (under "Tools & Settings > IP address banning (Fail2Ban), not everything is displayed as can be expected,

OR


- when activating jails, filters or even starting Fail2Ban from the Fail2Ban control panel, one gets

Error: Unable to add the IP address: f2bmng failed: ERROR NOK: ('database disk image is malformed',) ERROR:f2bmng:Command '['/usr/bin/fail2ban-client', 'reload']' returned non-zero exit status 255.

as an error notification.

ROOT CAUSE OF THE PROBLEM: the Fail2Ban sqlite database is corrupted.

SOLUTION:

1 - Read this KB article and follow steps 1 to 7 (to be found in the section "Resolution"), make sure that you remove the lines with terms like "malformed", "Rollback" and similar,

2 - Restart Fail2Ban from the command line, with the following commands:

- command: service fail2ban stop
- command: service fail2ban start

3 - if you are using Modsecurity, make sure that you read this thread : in case you just worked with some form of FTP transfer, including the Site Import Extension related transfers, it is very likely that the Fail2Ban database got corrupted due to some ModSecurity related settings.

Hope the above helps a bit......

Regards.......
 
Back
Top