{"record":{"id":"af8f97147034444c","repo":"netbirdio/netbird","slug":"generate-route-rule-spec-w","errorCode":null,"errorMessage":"generate route rule spec: %w","messagePattern":"generate route rule spec: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/firewall/iptables/router_linux.go","lineNumber":172,"sourceCode":"\tvar source firewall.Network\n\tif len(sources) > 1 {\n\t\tsource.Set = firewall.NewPrefixSet(sources)\n\t} else if len(sources) > 0 {\n\t\tsource.Prefix = sources[0]\n\t}\n\n\tparams := routeFilteringRuleParams{\n\t\tSource:      source,\n\t\tDestination: destination,\n\t\tProto:       proto,\n\t\tSPort:       sPort,\n\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","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/firewall/iptables/router_linux.go#L154-L190","documentation":"Error \"generate route rule spec: %w\" thrown in netbirdio/netbird.","triggerScenarios":"Thrown at client/firewall/iptables/router_linux.go:172 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"}