slackhq/nebula · warning
errAdapterNotFound
errAdapterNotFound
Error message
adapter not present in network connections enumeration
What it means
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.
Source
Thrown at overlay/network_category_windows.go:86
// x/sys/windows doesn't expose CoCreateInstance, so we bind it ourselves.
var procCoCreateInstance = windows.NewLazySystemDLL("ole32.dll").NewProc("CoCreateInstance")
const clsCtxAll = windows.CLSCTX_INPROC_SERVER | windows.CLSCTX_INPROC_HANDLER |
windows.CLSCTX_LOCAL_SERVER | windows.CLSCTX_REMOTE_SERVER
const (
hrSFALSE = 0x00000001
hrRPCEChangedMode = 0x80010106
)
type hresult uint32
func (h hresult) failed() bool { return int32(h) < 0 }
func (h hresult) String() string {
return fmt.Sprintf("HRESULT 0x%08x", uint32(h))
}
var errAdapterNotFound = errors.New("adapter not present in network connections enumeration")
// Vtable layouts. Slot order must match the declaration order in netlistmgr.h.
// All NLM interfaces here derive from IDispatch, which derives from IUnknown.
type iUnknownVtbl struct {
QueryInterface uintptr
AddRef uintptr
Release uintptr
}
type iDispatchVtbl struct {
iUnknownVtbl
GetTypeInfoCount uintptr
GetTypeInfo uintptr
GetIDsOfNames uintptr
Invoke uintptr
}
View on GitHub (pinned to dd8f660c0a)
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.
Example fix
// before: one-shot application, hard failure possible
if err := applyNetworkCategory(iface, cat); err != nil {
return err
}
// after: tolerate adapter-not-found as transient
if err := applyNetworkCategory(iface, cat); err != nil {
if !errors.Is(err, errAdapterNotFound) {
return err
}
// adapter not in NLM enumeration yet; requeue/retry
} Defensive patterns
Strategy: retry
Validate before calling
profiles, err := net.InterfaceByName(ifaceName)
if err != nil || (profiles.Flags&net.FlagUp) == 0 {
return fmt.Errorf("interface %s not up; skipping category set", ifaceName)
} Try / catch
if err := applyNetworkCategory(iface, cat); err != nil {
if errors.Is(err, errAdapterNotFound) {
l.Warn("adapter not in NLM enumeration yet; will retry", "iface", iface)
scheduleRetry(30*time.Second)
return nil
}
return err
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- INetwork.GetCategory: %s
- INetwork.SetCategory: %s
- CoInitializeEx: %w
- CoCreateInstance(NetworkListManager): %s
- unknown tun.network_category %q (expected public, private, d
AI-assisted analysis of slackhq/nebula@dd8f660c0a (2026-09-03).
Data as JSON: /api/errors/98e769fa37ed6f21.
Report an issue: GitHub.