{"record":{"id":"98e769fa37ed6f21","repo":"slackhq/nebula","slug":"erradapternotfound","errorCode":"errAdapterNotFound","errorMessage":"adapter not present in network connections enumeration","messagePattern":"adapter not present in network connections enumeration","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"overlay/network_category_windows.go","lineNumber":86,"sourceCode":"// x/sys/windows doesn't expose CoCreateInstance, so we bind it ourselves.\nvar procCoCreateInstance = windows.NewLazySystemDLL(\"ole32.dll\").NewProc(\"CoCreateInstance\")\n\nconst clsCtxAll = windows.CLSCTX_INPROC_SERVER | windows.CLSCTX_INPROC_HANDLER |\n\twindows.CLSCTX_LOCAL_SERVER | windows.CLSCTX_REMOTE_SERVER\n\nconst (\n\thrSFALSE          = 0x00000001\n\thrRPCEChangedMode = 0x80010106\n)\n\ntype hresult uint32\n\nfunc (h hresult) failed() bool { return int32(h) < 0 }\nfunc (h hresult) String() string {\n\treturn fmt.Sprintf(\"HRESULT 0x%08x\", uint32(h))\n}\n\nvar errAdapterNotFound = errors.New(\"adapter not present in network connections enumeration\")\n\n// Vtable layouts. Slot order must match the declaration order in netlistmgr.h.\n// All NLM interfaces here derive from IDispatch, which derives from IUnknown.\n\ntype iUnknownVtbl struct {\n\tQueryInterface uintptr\n\tAddRef         uintptr\n\tRelease        uintptr\n}\n\ntype iDispatchVtbl struct {\n\tiUnknownVtbl\n\tGetTypeInfoCount uintptr\n\tGetTypeInfo      uintptr\n\tGetIDsOfNames    uintptr\n\tInvoke           uintptr\n}\n","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/overlay/network_category_windows.go#L68-L104","documentation":"errAdapterNotFound is returned by the Windows network-category code when the NLM (INetworkListManager) enumeration of network connections yields no connection object for the adapter being configured (overlay/network_category_windows.go:311). It is checked at line 348 so the caller can log a warning and skip instead of treating it as a hard failure.","triggerScenarios":"setNetworkCategory walks INetworkListManager::GetNetworkConnections, finds no matching non-nil INetworkConnection for the target interface, and returns errAdapterNotFound. Happens inside applyNetworkCategory when setting the Windows network category on an interface that has no active NLM connection.","commonSituations":"Interface went down (link loss, Wi-Fi disconnect) between identification and category application; virtual adapters (VPN/Tailscale/WireGuard/Hyper-V) not yet fully initialized at boot; adapter has no active network profile in Windows' view; running before NLM has populated its connection list.","solutions":["Treat as transient: retry after a short delay, since NLM may not have enumerated the adapter yet.","Verify the interface is up and has an active network connection in Windows (Get-NetConnectionProfile).","Filter out down/virtual adapters before attempting to set the category.","Check that the service runs with sufficient privileges to query NLM and read the connection list.","If it persists, log-and-continue (as line 348 already does) and reapply the category on next network-change event."],"exampleFix":"// before: one-shot application, hard failure possible\nif err := applyNetworkCategory(iface, cat); err != nil {\n    return err\n}\n// after: tolerate adapter-not-found as transient\nif err := applyNetworkCategory(iface, cat); err != nil {\n    if !errors.Is(err, errAdapterNotFound) {\n        return err\n    }\n    // adapter not in NLM enumeration yet; requeue/retry\n}","handlingStrategy":"retry","validationCode":"profiles, err := net.InterfaceByName(ifaceName)\nif err != nil || (profiles.Flags&net.FlagUp) == 0 {\n    return fmt.Errorf(\"interface %s not up; skipping category set\", ifaceName)\n}","typeGuard":null,"tryCatchPattern":"if err := applyNetworkCategory(iface, cat); err != nil {\n    if errors.Is(err, errAdapterNotFound) {\n        l.Warn(\"adapter not in NLM enumeration yet; will retry\", \"iface\", iface)\n        scheduleRetry(30*time.Second)\n        return nil\n    }\n    return err\n}","preventionTips":["Retry category application on network-change events instead of once at startup.","Filter out down or non-physical adapters before touching NLM.","Confirm the process runs elevated enough to query the network list.","Accept it as transient on boot — NLM may not have enumerated virtual adapters yet."],"tags":["windows","network","com","network-category"],"backgroundTag":"adapter-not-found","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"}