{"record":{"id":"efe3cc33ee4e9998","repo":"netbirdio/netbird","slug":"delete-output-dnat-rule-w","errorCode":null,"errorMessage":"delete output DNAT rule: %w","messagePattern":"delete output DNAT rule: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/firewall/iptables/router_linux.go","lineNumber":1108,"sourceCode":"\t\t\"--to-destination\", \":\" + strconv.Itoa(int(translatedPort)),\n\t}\n\n\tif err := r.iptablesClient.Append(tableNat, chainNATOutput, dnatRule...); err != nil {\n\t\treturn fmt.Errorf(\"add output DNAT rule: %w\", err)\n\t}\n\tr.rules[ruleID] = dnatRule\n\n\tr.updateState()\n\treturn nil\n}\n\n// RemoveOutputDNAT removes an OUTPUT chain DNAT rule.\nfunc (r *router) RemoveOutputDNAT(localAddr netip.Addr, protocol firewall.Protocol, originalPort, translatedPort uint16) error {\n\truleID := fmt.Sprintf(\"output-dnat-%s-%s-%d-%d\", localAddr.String(), protocol, originalPort, translatedPort)\n\n\tif dnatRule, exists := r.rules[ruleID]; exists {\n\t\tif err := r.iptablesClient.Delete(tableNat, chainNATOutput, dnatRule...); err != nil {\n\t\t\treturn fmt.Errorf(\"delete output DNAT rule: %w\", err)\n\t\t}\n\t\tdelete(r.rules, ruleID)\n\t}\n\n\tr.updateState()\n\treturn nil\n}\n\nfunc applyPort(flag string, port *firewall.Port) []string {\n\tif port == nil {\n\t\treturn nil\n\t}\n\n\tif port.IsRange && len(port.Values) == 2 {\n\t\treturn []string{flag, fmt.Sprintf(\"%d:%d\", port.Values[0], port.Values[1])}\n\t}\n\n\tif len(port.Values) > 1 {","sourceCodeStart":1090,"sourceCodeEnd":1126,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/firewall/iptables/router_linux.go#L1090-L1126","documentation":"Error \"delete output DNAT rule: %w\" thrown in netbirdio/netbird.","triggerScenarios":"Thrown at client/firewall/iptables/router_linux.go:1108 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"}