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

  1. Treat as transient: retry after a short delay, since NLM may not have enumerated the adapter yet.
  2. Verify the interface is up and has an active network connection in Windows (Get-NetConnectionProfile).
  3. Filter out down/virtual adapters before attempting to set the category.
  4. Check that the service runs with sufficient privileges to query NLM and read the connection list.
  5. 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

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


AI-assisted analysis of slackhq/nebula@dd8f660c0a (2026-09-03). Data as JSON: /api/errors/98e769fa37ed6f21. Report an issue: GitHub.