{"record":{"id":"97031644b137ef38","repo":"slackhq/nebula","slug":"failed-to-set-address-w","errorCode":null,"errorMessage":"failed to set address: %w","messagePattern":"failed to set address: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"overlay/tun_windows.go","lineNumber":159,"sourceCode":"\t\t}\n\n\t\t// Ensure any routes we actually want are installed\n\t\terr = t.addRoutes(true)\n\t\tif err != nil {\n\t\t\t// Catch any stray logs\n\t\t\tutil.LogWithContextIfNeeded(\"Failed to add routes\", err, t.l)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (t *winTun) Activate() error {\n\tluid := winipcfg.LUID(t.tun.LUID())\n\n\terr := luid.SetIPAddresses(t.vpnNetworks)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to set address: %w\", err)\n\t}\n\n\terr = t.addRoutes(false)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif t.setCategory {\n\t\t// The wintun adapter takes a moment to register with the Network List\n\t\t// Manager, so we apply the category in the background and retry until\n\t\t// it shows up.\n\t\tgo applyNetworkCategory(t.l, t.guid, t.networkCategory)\n\t}\n\n\tif t.bypassWDF {\n\t\tt.wdfBypass = installInterfaceBypass(t.l, uint64(t.tun.LUID()))\n\t}\n","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/overlay/tun_windows.go#L141-L177","documentation":"Activate() failed while assigning the VPN IP addresses to the TUN interface via winipcfg LUID.SetIPAddresses. The library wraps the winipcfg error so callers know address configuration on the adapter failed. This typically reflects an OS-level rejection of the IP assignment.","triggerScenarios":"luid.SetIPAddresses(t.vpnNetworks) returns an error during interface activation — e.g. the configured address is invalid, already assigned, or conflicts with another adapter.","commonSituations":"Duplicate static IP on another interface; malformed tunes/overlay address in config (wrong CIDR); another VPN adapter holding the same subnet; race with adapter teardown.","solutions":["Verify the static_host_map/tun address and subnet mask in config are a valid CIDR","Check for another adapter using the same IP/subnet (ipconfig /all) and remove it","Remove and recreate stale VPN adapters","Restart the nebula process after fixing config","Check the wrapped error's winipcode (e.g. ERROR_OBJECT_ALREADY_EXISTS) for the specific cause"],"exampleFix":"// before\ntun:\n  routes: []\n  override_kernel: true\nstatic_single: 10.0.0.2/99\n// after\ntun:\n  routes: []\nstatic_single: 10.0.0.2/24","handlingStrategy":"validation","validationCode":"// validate configured CIDR before activation\nfor _, n := range cfg.Networks {\n    if _, _, err := net.ParseCIDR(string(n)); err != nil {\n        return fmt.Errorf(\"invalid tun network %q: %w\", n, err)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := tun.Activate(); err != nil {\n    if strings.Contains(err.Error(), \"failed to set address\") {\n        // check duplicate IP / subnet conflict and retry once\n    }\n    return err\n}","preventionTips":["Use a valid, unique VPN subnet in config","Remove conflicting adapters before activation","Avoid duplicate IPs across host interfaces","Fix malformed CIDR notation in tun config"],"tags":["windows","network","ip-address","winipcfg"],"backgroundTag":"ip-address-assignment-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"}