{"record":{"id":"a848db58d44d033b","repo":"netbirdio/netbird","slug":"error-configuring-interface-s-a848db","errorCode":null,"errorMessage":"error configuring interface: %s","messagePattern":"error configuring interface: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/iface/device/device_windows.go","lineNumber":117,"sourceCode":"\t\t\tnbiface6.NLMTU = uint32(t.mtu)\n\t\t\tif err := nbiface6.Set(); err != nil {\n\t\t\t\tlog.Warnf(\"failed to set IPv6 interface MTU, continuing v4-only: %v\", err)\n\t\t\t\tt.address.ClearIPv6()\n\t\t\t}\n\t\t}\n\t}\n\terr = t.assignAddr()\n\tif err != nil {\n\t\tt.device.Close()\n\t\treturn nil, fmt.Errorf(\"error assigning ip: %s\", err)\n\t}\n\n\tt.configurer = configurer.NewUSPConfigurer(t.device, t.name, t.iceBind.ActivityRecorder())\n\terr = t.configurer.ConfigureInterface(t.key, t.port)\n\tif err != nil {\n\t\tt.device.Close()\n\t\tt.configurer.Close()\n\t\treturn nil, fmt.Errorf(\"error configuring interface: %s\", err)\n\t}\n\treturn t.configurer, nil\n}\n\nfunc (t *TunDevice) Up() (*udpmux.UniversalUDPMuxDefault, error) {\n\terr := t.device.Up()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tudpMux, err := t.iceBind.GetICEMux()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tt.udpMux = udpMux\n\tlog.Debugf(\"device is ready to use: %s\", t.name)\n\treturn udpMux, nil\n}","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/iface/device/device_windows.go#L99-L135","documentation":"Windows Create() failed at configurer.ConfigureInterface, the same WGUSPConfigurer path as on unix: wgtypes.ParseKey on the private key, then device.IpcSet applying private_key/listen_port/fwmark to the userspace wireguard device. The configurer is created via NewUSPConfigurer (with UAPI listener, whose startup failure is only logged), so this wrap comes from key parsing or IpcSet. Both device and configurer are closed on failure.","triggerScenarios":"Invalid private key format; IpcSet rejecting listen_port or fwmark; the ICE bind unable to open the listen port; IpcSet against a concurrently closed device.","commonSituations":"Corrupted persisted key, port conflicts with another VPN client or agent instance, invalid fwmark under advanced routing.","solutions":["Pre-validate the private key with wgtypes.ParseKey before Create()","Ensure the wg port is free (netstat -ano) and only one instance runs","Enable debug logs to see the exact IpcSet error inside this wrap","Re-register the agent if the key is corrupted"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if _, err := wgtypes.ParseKey(privateKey); err != nil {\n    return fmt.Errorf(\"invalid private key: %w\", err)\n}\nif port < 1 || port > 65535 {\n    return fmt.Errorf(\"invalid listen port %d\", port)\n}","typeGuard":null,"tryCatchPattern":"if _, err := dev.Create(); err != nil {\n    if strings.Contains(err.Error(), \"error configuring interface\") {\n        // ParseKey or IpcSet failure: fix key/port, then retry full Create()\n    }\n    return err\n}","preventionTips":["Validate keys when loading persisted state","Keep one agent instance per port","Surface debug logs so the IpcSet cause is captured"],"tags":["windows","wireguard","configuration","ipc"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}