Fede Marsell
Basic Pleskian
- Server operating system version
- AlmaLinux release 8.10 (Cerulean Leopard)
- Plesk version and microupdate number
- 18.0.65 #1
Hello,
After migrating from CentSO to Almalinux, Fail2ban is not working properly. The problem occurs on several servers. Not just one.
The error is that Fail2ban does not create the rules in iptables, and for that reason it gives an error:
I have uninstalled Fail2Ban and reinstalled it, but the error persists.
I think the error may be because Almalinux comes with nf_tables instead of iptables. Could this be the cause?
Any solution to get Fail2Ban working again?
Thank you!!
Fede
After migrating from CentSO to Almalinux, Fail2ban is not working properly. The problem occurs on several servers. Not just one.
The error is that Fail2ban does not create the rules in iptables, and for that reason it gives an error:
2024-11-18 10:19:21,143 fail2ban.actions [1253]: ERROR Failed to flush bans in jail 'plesk-postfix' action 'iptables-multiport': Error flushing action Jail('plesk-postfix')/iptables-multiport: 'Script error'
2024-11-18 10:19:21,148 fail2ban.utils [1253]: ERROR 7f9adb032418 -- exec: for proto in $(echo 'tcp' | sed 's/,/ /g'); do
2024-11-18 10:19:21,148 fail2ban.utils [1253]: ERROR 7f9adb032418 -- stderr: "iptables v1.8.5 (nf_tables): Chain 'f2b-plesk-postfix' does not exist"
2024-11-18 10:19:21,148 fail2ban.utils [1253]: ERROR 7f9adb032418 -- stderr: "Try `iptables -h' or 'iptables --help' for more information."
2024-11-18 10:19:21,148 fail2ban.utils [1253]: ERROR 7f9adb032418 -- returned 2
2024-11-18 10:19:21,149 fail2ban.actions [1253]: ERROR Invariant check failed. Flush is impossible.
2024-11-18 10:19:21,157 fail2ban.utils [1253]: ERROR 7f9add780c90 -- exec: for proto in $(echo 'tcp' | sed 's/,/ /g'); do
2024-11-18 10:19:21,157 fail2ban.utils [1253]: ERROR 7f9add780c90 -- stderr: "iptables v1.8.5 (nf_tables): Chain 'f2b-plesk-postfix' does not exist"
2024-11-18 10:19:21,157 fail2ban.utils [1253]: ERROR 7f9add780c90 -- stderr: "Try `iptables -h' or 'iptables --help' for more information."
2024-11-18 10:19:21,157 fail2ban.utils [1253]: ERROR 7f9add780c90 -- stderr: 'iptables: No chain/target/match by that name.'
2024-11-18 10:19:21,157 fail2ban.utils [1253]: ERROR 7f9add780c90 -- stderr: 'iptables: No chain/target/match by that name.'
2024-11-18 10:19:21,157 fail2ban.utils [1253]: ERROR 7f9add780c90 -- returned 1
2024-11-18 10:19:21,157 fail2ban.actions [1253]: ERROR Failed to stop jail 'plesk-postfix' action 'iptables-multiport': Error stopping action Jail('plesk-postfix')/iptables-multiport: 'Script error'
I have uninstalled Fail2Ban and reinstalled it, but the error persists.
I think the error may be because Almalinux comes with nf_tables instead of iptables. Could this be the cause?
iptables v1.8.5 (nf_tables)
Any solution to get Fail2Ban working again?
Thank you!!
Fede