{"record":{"id":"2ddfcfe5e90d198b","repo":"tailscale/tailscale","slug":"failed-to-find-hook-rule-w","errorCode":null,"errorMessage":"Failed to find hook rule: %w","messagePattern":"Failed to find hook rule: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/linuxfw/nftables_runner.go","lineNumber":1136,"sourceCode":"\n\t\tpostroutingChain, err := getChainFromTable(conn, table.Nat, \"POSTROUTING\")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"get INPUT chain: %w\", err)\n\t\t}\n\t\terr = addHookRule(conn, table.Nat, postroutingChain, chainNamePostrouting)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Addhook: %w\", err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// delHookRule deletes a rule that jumps from a hooked chain to a regular chain.\nfunc delHookRule(conn *nftables.Conn, table *nftables.Table, fromChain *nftables.Chain, toChainName string) error {\n\trule := createHookRule(table, fromChain, toChainName)\n\texistingRule, err := findRule(conn, rule)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to find hook rule: %w\", err)\n\t}\n\n\tif existingRule == nil {\n\t\treturn nil\n\t}\n\n\t_ = conn.DelRule(existingRule)\n\n\tif err := conn.Flush(); err != nil {\n\t\treturn fmt.Errorf(\"flush del hook rule: %w\", err)\n\t}\n\treturn nil\n}\n\n// DelHooks is deleting the rules added to conventional chains to jump to tailscale chains.\nfunc (n *nftablesRunner) DelHooks(logf logger.Logf) error {\n\tconn := n.conn\n","sourceCodeStart":1118,"sourceCodeEnd":1154,"githubUrl":"https://github.com/tailscale/tailscale/blob/6e0912f97994f927632b34ae9e63b53d6516a6ac/util/linuxfw/nftables_runner.go#L1118-L1154","documentation":"delHookRule failed while searching for the existing jump rule with findRule; the lookup of the hook rule errored (netlink failure), so it cannot be determined whether the rule exists and deletion is aborted.","triggerScenarios":"Thrown at util/linuxfw/nftables_runner.go:1136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry DelHooks; rule lookup failures are often transient.","Verify the hooked chain is readable via 'nft list ruleset'.","Check netlink socket health and permissions."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6e0912f97994f927632b34ae9e63b53d6516a6ac","analyzedAt":"2026-08-18T08:17:25.280Z","contentChangedAt":"2026-08-18T08:17:25.280Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}