{"record":{"id":"bc712d78df4daa98","repo":"netbirdio/netbird","slug":"remove-iptables-forward-rule-v","errorCode":null,"errorMessage":"remove iptables forward rule: %v","messagePattern":"remove iptables forward rule: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/firewall/nftables/router_linux.go","lineNumber":1452,"sourceCode":"\t}\n\n\treturn *chain.Hooknum == *nftables.ChainHookForward || *chain.Hooknum == *nftables.ChainHookInput\n}\n\nfunc isIptablesTable(name string) bool {\n\tswitch name {\n\tcase tableNameFilter, tableNat, tableMangle, tableRaw, tableSecurity:\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (r *router) removeAcceptFilterRulesIptables(ipt *iptables.IPTables) error {\n\tvar merr *multierror.Error\n\n\tfor _, rule := range r.getAcceptForwardRules() {\n\t\tif err := ipt.DeleteIfExists(\"filter\", chainNameForward, rule...); err != nil {\n\t\t\tmerr = multierror.Append(merr, fmt.Errorf(\"remove iptables forward rule: %v\", err))\n\t\t}\n\t}\n\n\tinputRule := r.getAcceptInputRule()\n\tif err := ipt.DeleteIfExists(\"filter\", chainNameInput, inputRule...); err != nil {\n\t\tmerr = multierror.Append(merr, fmt.Errorf(\"remove iptables input rule: %v\", err))\n\t}\n\n\treturn nberrors.FormatErrorOrNil(merr)\n}\n\n// RemoveNatRule removes the prerouting mark rule\nfunc (r *router) RemoveNatRule(pair firewall.RouterPair) error {\n\tif err := r.refreshRulesMap(); err != nil {\n\t\treturn fmt.Errorf(refreshRulesMapError, err)\n\t}\n\n\tvar merr *multierror.Error","sourceCodeStart":1434,"sourceCodeEnd":1470,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/firewall/nftables/router_linux.go#L1434-L1470","documentation":"DeleteIfExists failed while removing one of NetBird's accept forward rules from the iptables filter FORWARD chain (compat path when iptables is present alongside nftables). The error is accumulated so the remaining rule deletions still run, and the caller learns the forward accept rule may still be installed.","triggerScenarios":"Thrown at client/firewall/nftables/router_linux.go:1452 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the nftables removal fallback","Verify iptables backend compatibility","Remove the rule manually with iptables -D"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","contentChangedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}