Articles in this section

Fail2ban jails not activated on Plesk server: NOK: ('database disk image is malformed')

Plesk for Linux kb: technical ABT: Group B

Applicable to:

  • Plesk for Linux

Symptoms

  • Activation of fail2ban jails / Re-reading IP addresses / Adding IP address to trusted fails with the following error in Plesk:

    PLESK_ERROR: 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:

    PLESK_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

  1. Log into the server via SSH;

    Note: If direct SSH access to the server is not possible, contact server administrator for further assistance.

  2. Backup the Fail2Ban sqlite database:

    # cp -a /var/lib/fail2ban/fail2ban.sqlite3{,.bkp}

  3. Remove the Fail2Ban sqlite database:

    # rm /var/lib/fail2ban/fail2ban.sqlite3

  4. 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

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.