{"record":{"id":"338cbab8e9a23f93","repo":"netchx/netch","slug":"redirector-start-failed","errorCode":null,"errorMessage":"Redirector start failed.","messagePattern":"Redirector start failed\\.","errorType":"exception","errorClass":"MessageException","httpStatus":null,"severity":"error","filePath":"Netch/Controllers/NFController.cs","lineNumber":76,"sourceCode":"            var dns = IPEndPoint.Parse(dnsStr);\n            if (dns.Port == 0)\n                dns.Port = 53;\n\n            Dial(NameList.AIO_DNSHOST, dns.Address.ToString());\n            Dial(NameList.AIO_DNSPORT, dns.Port.ToString());\n        }\n\n        // Server\n        Dial(NameList.AIO_TGTHOST, await server.AutoResolveHostnameAsync());\n        Dial(NameList.AIO_TGTPORT, server.Port.ToString());\n        Dial(NameList.AIO_TGTUSER, server.Username ?? string.Empty);\n        Dial(NameList.AIO_TGTPASS, server.Password ?? string.Empty);\n\n        // Mode Rule\n        DialRule();\n\n        if (!await InitAsync())\n            throw new MessageException(\"Redirector start failed.\");\n    }\n\n    public Task StopAsync()\n    {\n        return FreeAsync();\n    }\n\n    #region CheckRule\n\n    /// <summary>\n    /// </summary>\n    /// <param name=\"r\"></param>\n    /// <param name=\"clear\"></param>\n    /// <returns>No Problem true</returns>\n    private static bool CheckCppRegex(string r, bool clear = true)\n    {\n        try\n        {","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/netchx/netch/blob/9d99eb1c5a2acbf2a34f2600f94242601019a300/Netch/Controllers/NFController.cs#L58-L94","documentation":"Thrown by NFController.StartAsync after the native Redirector engine's InitAsync() (aio_init in Redirector.bin) returned false. By this point CheckDriver has run (driver installed/updated), filter/DNS/server/rule values were Dialed into the engine, and the final aio_init failed. The netfilter2 kernel driver must be registered and its service running for aio_init to succeed.","triggerScenarios":"netfilter2.sys driver is not installed or not registered (aio_register never succeeded); the netfilter2 service is stopped; the driver on disk is the wrong version/architecture; a Dial value (server host, regex rule, port) left the engine in a state that rejects init; Redirector.bin missing/corrupt so aio_init returns false.","commonSituations":"First run on a fresh install where the driver install step was skipped or failed silently; user uninstalled the driver; Windows blocked the unsigned/old driver; major Windows update invalidated the driver.","solutions":["Check logging for the Redirector init path and prior Dial results.","Ensure Netch runs as administrator so CheckDriver/InstallDriver can copy and register netfilter2.sys.","Manually trigger a reinstall: delete %SystemRoot%\\System32\\drivers\\netfilter2.sys and let NFController.CheckDriver reinstall on next start.","Verify the netfilter2 service exists and can start (sc query netfilter2).","Reinstall Netch to restore a compatible nfdriver.sys and Redirector.bin."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure the driver is installed/registered and Redirector.bin is present before Start.\nif (!File.Exists(Path.Combine(Global.NetchDir, \"bin\", \"Redirector.bin\")))\n    throw new MessageException(\"Redirector.bin missing\");\nif (!File.Exists(NFController.UninstallDriver() ? \"\" : \"%SystemRoot%\\\\System32\\\\drivers\\\\netfilter2.sys\")) { /* let CheckDriver install */ }\n// Require elevation:\nif (!OperatingSystem.IsWindows() || !HasAdminRights())\n    throw new MessageException(\"Redirector mode requires administrator privileges\");","typeGuard":null,"tryCatchPattern":"try { await nfController.StartAsync(server, mode); }\ncatch (MessageException ex) when (ex.Message == \"Redirector start failed.\")\n{\n    Log.Error(\"aio_init returned false; driver={Driver}\", NFController.UninstallDriver());\n    throw;\n}","preventionTips":["Run Netch as administrator for Redirector/Process modes.","Confirm netfilter2 service is registered (sc query netfilter2) before Start.","Let CheckDriver fully install/update the driver on first run.","Keep nfdriver.sys matching the bundled Redirector.bin version."],"tags":["driver","native-interop","redirector","startup"],"backgroundTag":null,"analyzedSha":"9d99eb1c5a2acbf2a34f2600f94242601019a300","analyzedAt":"2026-08-13T14:12:19.105Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}