{"record":{"id":"5a7cb18e3bb71737","repo":"netbirdio/netbird","slug":"get-rules-from-s-s-v","errorCode":null,"errorMessage":"get rules from %s/%s: %v","messagePattern":"get rules from (.+?)/(.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/firewall/nftables/router_linux.go","lineNumber":1354,"sourceCode":"\t\t\tcontinue\n\t\t}\n\n\t\tif chain.Name != chainNameForward && chain.Name != chainNameInput {\n\t\t\tcontinue\n\t\t}\n\n\t\tif err := r.removeAcceptRulesFromChain(table, chain); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn r.conn.Flush()\n}\n\nfunc (r *router) removeAcceptRulesFromChain(table *nftables.Table, chain *nftables.Chain) error {\n\trules, err := r.conn.GetRules(table, chain)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get rules from %s/%s: %v\", table.Name, chain.Name, err)\n\t}\n\n\tfor _, rule := range rules {\n\t\tif bytes.Equal(rule.UserData, []byte(userDataAcceptForwardRuleIif)) ||\n\t\t\tbytes.Equal(rule.UserData, []byte(userDataAcceptForwardRuleOif)) ||\n\t\t\tbytes.Equal(rule.UserData, []byte(userDataAcceptInputRule)) {\n\t\t\tif err := r.conn.DelRule(rule); err != nil {\n\t\t\t\treturn fmt.Errorf(\"delete rule from %s/%s: %v\", table.Name, chain.Name, err)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// removeExternalChainsRules removes our accept rules from all external chains.\n// This is deterministic - it scans for chains at removal time rather than relying on saved state,\n// ensuring cleanup works even after a crash or if chains changed.\nfunc (r *router) removeExternalChainsRules() error {","sourceCodeStart":1336,"sourceCodeEnd":1372,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/firewall/nftables/router_linux.go#L1336-L1372","documentation":"GetRules failed for the named table/chain while removeAcceptRulesFromChain was enumerating rules to strip NetBird's accept forward/input rules. Without the listing the cleanup cannot identify which rules carry NetBird's UserData markers, so it aborts rather than risk touching foreign rules; Flush of the deletions never runs.","triggerScenarios":"Thrown at client/firewall/nftables/router_linux.go:1354 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the rules query","Confirm the table and chain exist","Check the nftables connection state"],"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"}