{"record":{"id":"d2d9bd28848c048a","repo":"netbirdio/netbird","slug":"add-route-rule-v","errorCode":null,"errorMessage":"add route rule: %v","messagePattern":"add route rule: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/firewall/iptables/router_linux.go","lineNumber":184,"sourceCode":"\t\tDPort:       dPort,\n\t\tAction:      action,\n\t}\n\n\trule, err := r.genRouteRuleSpec(params, sources)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"generate route rule spec: %w\", err)\n\t}\n\n\t// Insert DROP rules at the beginning, append ACCEPT rules at the end\n\tif action == firewall.ActionDrop {\n\t\t// after the established rule\n\t\terr = r.iptablesClient.Insert(tableFilter, chainRTFWDIN, 2, rule...)\n\t} else {\n\t\terr = r.iptablesClient.Append(tableFilter, chainRTFWDIN, rule...)\n\t}\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"add route rule: %v\", err)\n\t}\n\n\tr.rules[string(ruleKey)] = rule\n\n\tr.updateState()\n\n\treturn ruleKey, nil\n}\n\nfunc (r *router) hasRule(id string) bool {\n\t_, ok := r.rules[id]\n\treturn ok\n}\n\nfunc (r *router) DeleteRouteRule(rule firewall.Rule) error {\n\truleKey := rule.ID()\n\n\tif rule, exists := r.rules[ruleKey]; exists {","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/firewall/iptables/router_linux.go#L166-L202","documentation":"Error \"add route rule: %v\" thrown in netbirdio/netbird.","triggerScenarios":"Thrown at client/firewall/iptables/router_linux.go:184 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"}