Symptoms
-
Activation of fail2ban jails / Re-reading IP addresses / Adding IP address to trusted fails with the following error in Plesk:
ERROR NOK: ('database disk image is malformed',)
ERROR NOK: ('columns jail, path, firstlinemd5 are not unique',)
ERROR NOK: ('database or disk is full',)
ERROR:f2bmng:Command '['/usr/bin/fail2ban-client', 'reload', 'plesk-wordpress']' returned non-zero exit status 255
ERROR:f2bmng:Failed to reload following jails due to errors in configuration: plesk-wordpress -
Removing IP address from the trusted list can fail with the error:
Unable to remove some IP addresses from the list of trusted addresses: f2bmng failed: 2020-01-01 12:00:00,576 fail2ban [9512]: ERROR NOK: ('Cannot change database when there are jails present',)
ERROR:__main__:Command '['/usr/bin/fail2ban-client', 'reload']' returned non-zero exit status 255.
Cause
fail2ban
sqlite database file is corrupted.
Resolution
-
Log into the server via SSH;
Note: If direct SSH access to the server is not possible, contact server administrator for further assistance.
-
Backup the Fail2Ban sqlite database:
# cp -a /var/lib/fail2ban/fail2ban.sqlite3{,.bkp}
-
Remove the Fail2Ban sqlite database:
# rm /var/lib/fail2ban/fail2ban.sqlite3
-
Re-install Fail2Ban:
-
From Plesk interface using the article component How to install / uninstall Plesk components?
-
From CLI using the commands below:
# plesk installer --select-release-current --remove-component fail2ban
# plesk installer --select-release-current --install-component fail2ban
-