{"record":{"id":"61d65275824af0ea","repo":"netbirdio/netbird","slug":"got-error-when-getting-ip-interface-s","errorCode":null,"errorMessage":"got error when getting ip interface %s","messagePattern":"got error when getting ip interface (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/iface/device/device_windows.go","lineNumber":82,"sourceCode":"\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating tun device: %s\", err)\n\t}\n\tt.nativeTunDevice = tunDevice.(*tun.NativeTun)\n\tt.filteredDevice = newDeviceFilter(tunDevice)\n\n\t// We need to create a wireguard-go device and listen to configuration requests\n\tt.device = device.NewDevice(\n\t\tt.filteredDevice,\n\t\tt.iceBind,\n\t\tdevice.NewLogger(wgLogLevel(), \"[netbird] \"),\n\t)\n\n\tluid := winipcfg.LUID(t.nativeTunDevice.LUID())\n\n\tnbiface, err := luid.IPInterface(windows.AF_INET)\n\tif err != nil {\n\t\tt.device.Close()\n\t\treturn nil, fmt.Errorf(\"got error when getting ip interface %s\", err)\n\t}\n\n\tnbiface.NLMTU = uint32(t.mtu)\n\n\terr = nbiface.Set()\n\tif err != nil {\n\t\tt.device.Close()\n\t\treturn nil, fmt.Errorf(\"set IPv4 interface MTU: %s\", err)\n\t}\n\n\tif t.address.HasIPv6() {\n\t\tnbiface6, err := luid.IPInterface(windows.AF_INET6)\n\t\tif err != nil {\n\t\t\tlog.Warnf(\"failed to get IPv6 interface for MTU, continuing v4-only: %v\", err)\n\t\t\tt.address.ClearIPv6()\n\t\t} else {\n\t\t\tnbiface6.NLMTU = uint32(t.mtu)\n\t\t\tif err := nbiface6.Set(); err != nil {","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/iface/device/device_windows.go#L64-L100","documentation":"Windows Create() queries the adapter's IPv4 interface row via winipcfg LUID.IPInterface(windows.AF_INET) (GetIpInterfaceEntry) right after adapter creation, to set the tunnel MTU. This error means the Network Localization API could not return that row; the wireguard-go device is closed and creation aborts. The IPv6 twin query later is soft (warn plus ClearIPv6), but this IPv4 query is fatal.","triggerScenarios":"The adapter vanished between creation and the query (driver/AV interference), an invalid LUID, the IPv4 interface row not yet committed by the stack, or a transient winipcfg API error.","commonSituations":"Antivirus or third-party VPN filters tearing down adapters, slow driver initialization on busy hosts, adapter churn from repeated connect cycles.","solutions":["Retry Create() once after a short delay; this is often a transient race","Conflict-check third-party VPN/AV network filter drivers","Update the wintun driver / NetBird client if it reproduces deterministically","Check Windows Event Log (System) for adapter/driver errors at that timestamp"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"var row *winipcfg.MibIPInterfaceRow\nerr := retry(3, 250*time.Millisecond, func() error {\n    r, e := luid.IPInterface(windows.AF_INET)\n    row = r\n    return e\n})\nif err != nil {\n    return fmt.Errorf(\"ip interface row unavailable: %w\", err)\n}","preventionTips":["Treat the post-creation IPInterface query as racy and retry briefly","Minimize third-party filter drivers that tear down fresh adapters","Log the LUID and adapter name to correlate with Event Log entries"],"tags":["windows","winipcfg","adapter","transient","mtu"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}