{"record":{"id":"b9df73c3a9eb7c9f","repo":"slackhq/nebula","slug":"inetworklistmanager-getnetworkconnections-s","errorCode":null,"errorMessage":"INetworkListManager.GetNetworkConnections: %s","messagePattern":"INetworkListManager\\.GetNetworkConnections: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"overlay/network_category_windows.go","lineNumber":128,"sourceCode":"\tGetNetworkConnection  uintptr\n\tIsConnectedToInternet uintptr\n\tIsConnected           uintptr\n\tGetConnectivity       uintptr\n}\n\ntype iNetworkListManager struct{ Vtbl *iNetworkListManagerVtbl }\n\nfunc (n *iNetworkListManager) Release() {\n\tsyscall.SyscallN(n.Vtbl.Release, uintptr(unsafe.Pointer(n)))\n}\n\nfunc (n *iNetworkListManager) GetNetworkConnections() (*iEnumNetworkConnections, error) {\n\tvar enum *iEnumNetworkConnections\n\tr1, _, _ := syscall.SyscallN(n.Vtbl.GetNetworkConnections,\n\t\tuintptr(unsafe.Pointer(n)), uintptr(unsafe.Pointer(&enum)),\n\t)\n\tif hr := hresult(r1); hr.failed() {\n\t\treturn nil, fmt.Errorf(\"INetworkListManager.GetNetworkConnections: %s\", hr)\n\t}\n\treturn enum, nil\n}\n\ntype iEnumNetworkConnectionsVtbl struct {\n\tiDispatchVtbl\n\tNewEnum uintptr\n\tNext    uintptr\n\tSkip    uintptr\n\tReset   uintptr\n\tClone   uintptr\n}\n\ntype iEnumNetworkConnections struct{ Vtbl *iEnumNetworkConnectionsVtbl }\n\nfunc (e *iEnumNetworkConnections) Release() {\n\tsyscall.SyscallN(e.Vtbl.Release, uintptr(unsafe.Pointer(e)))\n}","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/overlay/network_category_windows.go#L110-L146","documentation":"This error wraps a failed HRESULT from the COM method INetworkListManager::GetNetworkConnections, used by Nebula on Windows to enumerate network connections when classifying the network category. A failed HRESULT here means the COM call into the Windows Network List Manager (NLM) service did not succeed (e.g. service unavailable, COM not initialized, or access denied). The hresult is formatted into the message.","triggerScenarios":"Calling GetNetworkConnections() during tun setup (via newTun → network category detection) when the NLM COM object's vtbl call returns a failing HRESULT, such as when the NlaSvc/network service is stopped or COM initialization failed on the thread.","commonSituations":"Windows Network List Manager service (netprofm/NlaSvc) disabled or crashed; running in a service/session context where COM apartment initialization differs; restricted service accounts lacking permission; heavily locked-down or stripped Windows images.","solutions":["Ensure the 'Network List Service' (netprofm) and related services are running: sc query netprofm / net start netprofm","Verify COM was initialized on the calling thread (coInit succeeded, correct apartment model) before the call","Run the process under an account with rights to query network state; test outside a heavily restricted service context","Decode the hresult (e.g. 0x80004005 vs RPC_E_*) to identify the precise COM failure and address it","If classification is optional, treat the failure as non-fatal and fall back to leaving the category unset"],"exampleFix":"// before\nconns, err := nlm.GetNetworkConnections()\nif err != nil { return err }\n// after: degrade gracefully\nconns, err := nlm.GetNetworkConnections()\nif err != nil {\n    l.WithError(err).Warn(\"unable to enumerate network connections; skipping category detection\")\n    return nil\n}","handlingStrategy":"try-catch","validationCode":"// preflight: ensure the Network List Service is reachable before classification\nfunc nlmAvailable() error {\n    s, err := svcQuery(\"netprofm\")\n    if err != nil { return err }\n    if s != \"RUNNING\" { return fmt.Errorf(\"netprofm is %s\", s) }\n    return nil\n}","typeGuard":"func isHresultError(err error) bool {\n    return err != nil && strings.HasPrefix(err.Error(), \"INetworkListManager.\")\n}","tryCatchPattern":"conns, err := nlm.GetNetworkConnections()\nif err != nil {\n    log.Warnf(\"NLM unavailable, skipping category detection: %v\", err)\n    return nil // degrade gracefully\n}","preventionTips":["Keep the Network List Service (netprofm) running on hosts running the tunnel","Initialize COM on the same OS thread used for all NLM calls","Check hresult codes in the message to diagnose service vs permission issues","Make category classification best-effort, never a hard startup dependency"],"tags":["windows","com","network-list-manager","winapi"],"backgroundTag":"com-call-failed","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"}