jdx/mise · error
firewall rule ' ' uses per-source connection limiting…
Error message
firewall rule '{}' uses per-source connection limiting, which firewalld policies cannot express safely; select backend = "nftables" or "ufw" What it means
Firewalld policies cannot express per-source connection limiting safely, so the library rejects any action = "limit" rule when the selected backend is Firewalld. It directs the developer to nftables or ufw, which can implement source-scoped rate limiting correctly.
Solutions
- Change the request's backend to FirewallBackend::Nftables or FirewallBackend::Ufw.
- Remove or rework the limit rule into plain allow/deny rules compatible with firewalld.
- Install and manage nftables/ufw on the host if per-source limiting is required.
- Split deployment: apply limit rules via a nftables-backed request and the rest via firewalld.
Example fix
// before
apply(&FirewallRequest { backend: FirewallBackend::Firewalld, rules: vec![limit_rule], .. }, false, true)?
// after
apply(&FirewallRequest { backend: FirewallBackend::Nftables, rules: vec![limit_rule], .. }, false, true)? Defensive patterns
Strategy: validation
Validate before calling
fn limit_compatible(backend: FirewallBackend, rules: &[FirewallRule]) -> bool {
backend != FirewallBackend::Firewalld
|| !rules.iter().any(|r| r.action == FirewallAction::Limit)
} Try / catch
match apply(&request, false, true) {
Err(e) if e.to_string().contains("firewalld policies cannot express") => {
eprintln!("switch backend to nftables or ufw for limit rules");
}
other => other?,
} Prevention
- Choose backend based on required rule features, not habit
- Keep per-backend rule capability checks in config loaders
- Test rule sets against the intended backend in CI
- Avoid mixing firewalld hosts with limit-style rule templates
When it happens
Trigger: Submitting a FirewallRequest containing a rule with action = FirewallAction::Limit while backend = FirewallBackend::Firewalld.
Common situations: Team standardized on firewalld but copied an SSH rate-limit rule from an nftables/ufw config; migrating rule sets between backends without adjusting the backend field; a default backend of firewalld combined with pre-built limit rules.
Related errors
- firewall rule ' ' uses interface matching, which firewalld…
- refusing firewall default incoming
- bootstrap firewall management is only supported on Linux
- firewall backend ' ' requires command
- firewall interface ' ' is invalid
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/ede978a99f082bc3.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/firewall.rs:1052
}
FirewallBackend::Ufw => backend_active(backend),
FirewallBackend::Auto => false,
}
}
fn validate_backend_request(request: &FirewallRequest, backend: FirewallBackend) -> Result<()> {
for rule in &request.rules {
if rule.action == FirewallAction::Limit {
if rule.direction != FirewallDirection::Incoming
|| rule.protocol != Some(FirewallProtocol::Tcp)
{
bail!(
"firewall rule '{}' uses action = \"limit\", which requires direction = \"incoming\" and protocol = \"tcp\"",
rule.name
);
}
if backend == FirewallBackend::Firewalld {
bail!(
"firewall rule '{}' uses per-source connection limiting, which firewalld policies cannot express safely; select backend = \"nftables\" or \"ufw\"",
rule.name
);
}
}
if backend == FirewallBackend::Firewalld && rule.interface.is_some() {
bail!(
"firewall rule '{}' uses interface matching, which firewalld policies cannot express safely; select backend = \"nftables\" or \"ufw\"",
rule.name
);
}
if backend == FirewallBackend::Ufw
&& matches!(
rule.protocol,
Some(FirewallProtocol::Sctp | FirewallProtocol::Dccp)
)
{
bail!(View on GitHub (pinned to 533346cc37)