{"record":{"id":"d314a636e88f6f06","repo":"netbirdio/netbird","slug":"add-prerouting-proxy-notrack-rule-w","errorCode":null,"errorMessage":"add prerouting proxy notrack rule: %w","messagePattern":"add prerouting proxy notrack rule: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/firewall/iptables/manager_linux.go","lineNumber":580,"sourceCode":"\toutputRuleSport := []string{\"-o\", \"lo\", \"-s\", \"127.0.0.1\", \"-d\", \"127.0.0.1\", \"-p\", \"udp\", \"--sport\", wgPortStr, \"-j\", \"NOTRACK\"}\n\tif err := m.ipv4Client.AppendUnique(tableRaw, chainNameRaw, outputRuleSport...); err != nil {\n\t\treturn fmt.Errorf(\"add output sport notrack rule: %w\", err)\n\t}\n\n\toutputRuleDport := []string{\"-o\", \"lo\", \"-s\", \"127.0.0.1\", \"-d\", \"127.0.0.1\", \"-p\", \"udp\", \"--dport\", wgPortStr, \"-j\", \"NOTRACK\"}\n\tif err := m.ipv4Client.AppendUnique(tableRaw, chainNameRaw, outputRuleDport...); err != nil {\n\t\treturn fmt.Errorf(\"add output dport notrack rule: %w\", err)\n\t}\n\n\t// Ingress rules: match incoming loopback UDP packets\n\tpreroutingRuleWg := []string{\"-i\", \"lo\", \"-s\", \"127.0.0.1\", \"-d\", \"127.0.0.1\", \"-p\", \"udp\", \"--dport\", wgPortStr, \"-j\", \"NOTRACK\"}\n\tif err := m.ipv4Client.AppendUnique(tableRaw, chainNameRaw, preroutingRuleWg...); err != nil {\n\t\treturn fmt.Errorf(\"add prerouting wg notrack rule: %w\", err)\n\t}\n\n\tpreroutingRuleProxy := []string{\"-i\", \"lo\", \"-s\", \"127.0.0.1\", \"-d\", \"127.0.0.1\", \"-p\", \"udp\", \"--dport\", proxyPortStr, \"-j\", \"NOTRACK\"}\n\tif err := m.ipv4Client.AppendUnique(tableRaw, chainNameRaw, preroutingRuleProxy...); err != nil {\n\t\treturn fmt.Errorf(\"add prerouting proxy notrack rule: %w\", err)\n\t}\n\n\tlog.Debugf(\"set up ebpf proxy notrack rules for ports %d,%d\", proxyPort, wgPort)\n\treturn nil\n}\n\nfunc (m *Manager) initNoTrackChain() error {\n\tif err := m.cleanupNoTrackChain(); err != nil {\n\t\tlog.Debugf(\"cleanup notrack chain: %v\", err)\n\t}\n\n\tif err := m.ipv4Client.NewChain(tableRaw, chainNameRaw); err != nil {\n\t\treturn fmt.Errorf(\"create chain: %w\", err)\n\t}\n\n\tjumpRule := []string{\"-j\", chainNameRaw}\n\n\tif err := m.ipv4Client.InsertUnique(tableRaw, chainOUTPUT, 1, jumpRule...); err != nil {","sourceCodeStart":562,"sourceCodeEnd":598,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/firewall/iptables/manager_linux.go#L562-L598","documentation":"Appending the PREROUTING-chain NOTRACK rule for the local proxy port in the iptables raw table failed. Like the wg-port variant, this exempts loopback traffic to the userspace proxy port from conntrack; iptables refusing the append leaves the exemption incomplete, so initialization stops rather than installing a partial NOTRACK configuration that would silently break proxied flows.","triggerScenarios":"Thrown at client/firewall/iptables/manager_linux.go:580 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect iptables state and privileges as with the sibling notrack failures","Remove partially added rules by restarting the daemon, which cleans up and retries","Switch to the nftables backend if the raw table stays flaky"],"exampleFix":null,"handlingStrategy":"retry","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"}