{"record":{"id":"0efbd70119e1fc84","repo":"slackhq/nebula","slug":"failed-to-get-ip-interface-w","errorCode":null,"errorMessage":"failed to get ip interface: %w","messagePattern":"failed to get ip interface: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"overlay/tun_windows.go","lineNumber":215,"sourceCode":"\t\t\t\tretErr.Log(t.l)\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\treturn retErr\n\t\t\t}\n\t\t} else {\n\t\t\tt.l.Info(\"Added route\", \"route\", r)\n\t\t}\n\n\t\tif !foundDefault4 {\n\t\t\tif r.Cidr.Bits() == 0 && r.Cidr.Addr().BitLen() == 32 {\n\t\t\t\tfoundDefault4 = true\n\t\t\t}\n\t\t}\n\t}\n\n\tipif, err := luid.IPInterface(windows.AF_INET)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get ip interface: %w\", err)\n\t}\n\n\tipif.NLMTU = uint32(t.MTU)\n\tif foundDefault4 {\n\t\tipif.UseAutomaticMetric = false\n\t\tipif.Metric = 0\n\t}\n\n\tif err := ipif.Set(); err != nil {\n\t\treturn fmt.Errorf(\"failed to set ip interface: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (t *winTun) removeRoutes(routes []Route) error {\n\tluid := winipcfg.LUID(t.tun.LUID())\n\n\tfor _, r := range routes {","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/overlay/tun_windows.go#L197-L233","documentation":"addRoutes failed to retrieve the IPv4 IP interface for the TUN adapter via luid.IPInterface(windows.AF_INET). The library wraps the winipcfg error before applying MTU/metric settings. Getting this means the interface disappeared or is not fully initialized in Windows.","triggerScenarios":"Called from Activate() or reload() when luid.IPInterface(windows.AF_INET) fails — typically because the adapter was removed, is disabled, or the LUID is no longer valid at route-config time.","commonSituations":"VPN adapter deleted by antivirus/VPN conflict software between creation and route setup; adapter disabled; rapid reload racing with teardown; driver in a bad state after sleep/resume.","solutions":["Restart the nebula service to recreate the TUN device","Check the adapter exists and is enabled in Device Manager / Get-NetAdapter","Disable conflicting VPN/filter software that tears down wintun adapters","Verify the wrapped error code (ERROR_NOT_FOUND usually = adapter gone)","Update wintun driver if failures recur after sleep/resume"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// confirm the adapter is present before route setup\nadapters, _ := winipcfg.GetAdaptersAddresses(windows.AF_INET, 0)\nfound := false\nfor _, a := range adapters {\n    if a.LUID == luid { found = true }\n}\nif !found { return errors.New(\"TUN adapter vanished before route setup\") }","typeGuard":null,"tryCatchPattern":"if err := tun.Activate(); err != nil {\n    if strings.Contains(err.Error(), \"failed to get ip interface\") {\n        time.Sleep(500 * time.Millisecond)\n        return tun.Activate() // retry after adapter settles\n    }\n    return err\n}","preventionTips":["Disable software that removes wintun adapters (some AV/VPN tools)","Avoid reloading config while the adapter is being torn down","Recreate the TUN if the interface disappears","Check adapter state after sleep/resume"],"tags":["windows","routing","winipcfg","network-interface"],"backgroundTag":"interface-not-found-by-ip","analyzedSha":"dd8f660c0ac37903ec4080ca4d3c861ba9342ceb","analyzedAt":"2026-09-03T11:13:55.444Z","contentChangedAt":"2026-09-03T11:13:55.444Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}