#1121856 fail2ban: Fail2ban does not depend on nftables but it should

#1121856#5
Date:
2025-12-03 18:59:04 UTC
From:
To:
Dear Maintainer,

I have installed fail2ban on a newly deployed Debian 13 (from french vps
provider OVH). Fail2ban tried to ban ip addresses but logged an error
like this:

ERROR   Failed to execute ban jail 'sshd' action 'nftables' info 'ActionInfo({'ip': '165.232.82.131', 'family': 'inet4', 'fid': <function Actions.ActionInfo.<lambda> at 0x7f7843370c20>, 'raw-ticket': <function Actions.ActionInfo.<lambda> at 0x7f78433713a0>})': Error starting action Jail('sshd')/nftables: 'Script error'

The issue is simple: the "nft" command was missing.

apt install nftables resolved this issue.

I see that fail2ban recommends nft but does not require nft, so it did
not get installed, probably because iptables was already installed.


Now, since I knew fail2ban in Debian 13 uses nftables, I checked for it
and found it was not installed, but if I did not know this, I'd get a
non-working fail2ban that apparently works just fine (no errors, banned
hosts show up properly when doing "fail2ban client status") and the only way
of finding the issue is by checking the logs or actually checking if nft rules were actually added or not.