Fail2ban extension hangs: Failed to stop jail action

Follow

Comments

4 comments

  • Avatar
    Gianluca

    Hello, solution for CentOS 7 applied, but error persist:

     

    2017-01-09 10:13:16,967 fail2ban.action         [13400]: ERROR   iptables -D INPUT -p tcp -m multiport --dports http,https,7080,7081 -j f2b-plesk-wordpress
    iptables -F f2b-plesk-wordpress
    iptables -X f2b-plesk-wordpress -- stderr: 'iptables: Too many links.\n'
    2017-01-09 10:13:16,968 fail2ban.action         [13400]: ERROR   iptables -D INPUT -p tcp -m multiport --dports http,https,7080,7081 -j f2b-plesk-wordpress
    iptables -F f2b-plesk-wordpress
    iptables -X f2b-plesk-wordpress -- returned 1
    2017-01-09 10:13:16,968 fail2ban.actions        [13400]: ERROR   Failed to stop jail 'plesk-wordpress-j' action 'iptables-multiport': Error stopping action
    2017-01-09 10:13:16,969 fail2ban.jail           [13400]: INFO    Jail 'plesk-wordpress-j' stopped
    2017-01-09 10:13:17,420 fail2ban.action         [13400]: ERROR   iptables -D INPUT -p tcp -m multiport --dports http,https,7080,7081 -j f2b-plesk-wordpress
    iptables -F f2b-plesk-wordpress
    iptables -X f2b-plesk-wordpress -- stdout: ''
    2017-01-09 10:13:17,420 fail2ban.action         [13400]: ERROR   iptables -D INPUT -p tcp -m multiport --dports http,https,7080,7081 -j f2b-plesk-wordpress
    iptables -F f2b-plesk-wordpress
    iptables -X f2b-plesk-wordpress -- stderr: 'iptables: Too many links.\n'

  • Avatar
    Vitaly Zhidkov

    @Gianluca, try the following workaround and let me know if it will not help:

    1. Backup file /usr/lib/pythonX.X/dist-packages/fail2ban/server/database.py where X.X is a Python version).

    2. Modify /usr/lib/pythonX.X/dist-packages/fail2ban/server/database.py The lines to add are marked with '+' sign:

            cur = self._db.cursor()
            cur.execute("PRAGMA foreign_keys = ON;")
        +   cur.execute("PRAGMA synchronous = OFF;")
        +   cur.execute("PRAGMA journal_mode = MEMORY;")
        
            try:
                cur.execute("SELECT version FROM fail2banDb LIMIT 1")

  • Avatar
    Gianluca

    Thank you for your answer Vitaly, but i have Onyx and the file "/usr/lib/python2.7/site-packages/fail2ban/server/database.py" (path "/usr/lib/pythonX.X/dist-packages/...." doesn't exist on my server) already contains that lines.

  • Avatar
    Alexander Nezymaev

    @Gianluca, I am going to create a ticket for you in our support system.

    We will contact you soon by email.

Please sign in to leave a comment.