{"record":{"id":"90ee2b0cde560ccb","repo":"netbirdio/netbird","slug":"create-chain-w","errorCode":null,"errorMessage":"create chain: %w","messagePattern":"create chain: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/firewall/iptables/manager_linux.go","lineNumber":593,"sourceCode":"\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 {\n\t\tif delErr := m.ipv4Client.DeleteChain(tableRaw, chainNameRaw); delErr != nil {\n\t\t\tlog.Debugf(\"delete orphan chain: %v\", delErr)\n\t\t}\n\t\treturn fmt.Errorf(\"add output jump rule: %w\", err)\n\t}\n\n\tif err := m.ipv4Client.InsertUnique(tableRaw, chainPREROUTING, 1, jumpRule...); err != nil {\n\t\tif delErr := m.ipv4Client.DeleteIfExists(tableRaw, chainOUTPUT, jumpRule...); delErr != nil {\n\t\t\tlog.Debugf(\"delete output jump rule: %v\", delErr)\n\t\t}\n\t\tif delErr := m.ipv4Client.DeleteChain(tableRaw, chainNameRaw); delErr != nil {\n\t\t\tlog.Debugf(\"delete orphan chain: %v\", delErr)\n\t\t}","sourceCodeStart":575,"sourceCodeEnd":611,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/firewall/iptables/manager_linux.go#L575-L611","documentation":"Error \"create chain: %w\" thrown in netbirdio/netbird.","triggerScenarios":"Thrown at client/firewall/iptables/manager_linux.go:593 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}