netchx/netch · error · MessageException
Redirector start failed.
Error message
Redirector start failed.
What it means
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.
Source
Thrown at Netch/Controllers/NFController.cs:76
var dns = IPEndPoint.Parse(dnsStr);
if (dns.Port == 0)
dns.Port = 53;
Dial(NameList.AIO_DNSHOST, dns.Address.ToString());
Dial(NameList.AIO_DNSPORT, dns.Port.ToString());
}
// Server
Dial(NameList.AIO_TGTHOST, await server.AutoResolveHostnameAsync());
Dial(NameList.AIO_TGTPORT, server.Port.ToString());
Dial(NameList.AIO_TGTUSER, server.Username ?? string.Empty);
Dial(NameList.AIO_TGTPASS, server.Password ?? string.Empty);
// Mode Rule
DialRule();
if (!await InitAsync())
throw new MessageException("Redirector start failed.");
}
public Task StopAsync()
{
return FreeAsync();
}
#region CheckRule
/// <summary>
/// </summary>
/// <param name="r"></param>
/// <param name="clear"></param>
/// <returns>No Problem true</returns>
private static bool CheckCppRegex(string r, bool clear = true)
{
try
{View on GitHub (pinned to 9d99eb1c5a)
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.
Defensive patterns
Strategy: validation
Validate before calling
// Ensure the driver is installed/registered and Redirector.bin is present before Start.
if (!File.Exists(Path.Combine(Global.NetchDir, "bin", "Redirector.bin")))
throw new MessageException("Redirector.bin missing");
if (!File.Exists(NFController.UninstallDriver() ? "" : "%SystemRoot%\\System32\\drivers\\netfilter2.sys")) { /* let CheckDriver install */ }
// Require elevation:
if (!OperatingSystem.IsWindows() || !HasAdminRights())
throw new MessageException("Redirector mode requires administrator privileges"); Try / catch
try { await nfController.StartAsync(server, mode); }
catch (MessageException ex) when (ex.Message == "Redirector start failed.")
{
Log.Error("aio_init returned false; driver={Driver}", NFController.UninstallDriver());
throw;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- tun2socks start failed.
- AioDNS start failed.
- bin\{mainFile} file not found!
- {Name} 控制器启动失败
- {e.Message} Missing File or runtime components
AI-assisted analysis of netchx/netch@9d99eb1c5a (2026-08-13).
Data as JSON: /api/errors/338cbab8e9a23f93.
Report an issue: GitHub.