{"record":{"id":"14990b8b871a7871","repo":"netbirdio/netbird","slug":"failed-to-decode-hex-key-w","errorCode":null,"errorMessage":"failed to decode hex key: %w","messagePattern":"failed to decode hex key: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/iface/configurer/usp.go","lineNumber":514,"sourceCode":"\treturn time.Unix(sec, 0), nil\n}\n\nfunc toBytes(s string) (int64, error) {\n\treturn strconv.ParseInt(s, 10, 64)\n}\n\nfunc getFwmark() int {\n\tif nbnet.AdvancedRouting() && runtime.GOOS == \"linux\" {\n\t\treturn nbnet.ControlPlaneMark\n\t}\n\treturn 0\n}\n\nfunc hexToWireguardKey(hexKey string) (wgtypes.Key, error) {\n\t// Decode hex string to bytes\n\tkeyBytes, err := hex.DecodeString(hexKey)\n\tif err != nil {\n\t\treturn wgtypes.Key{}, fmt.Errorf(\"failed to decode hex key: %w\", err)\n\t}\n\n\t// Check if we have the right number of bytes (WireGuard keys are 32 bytes)\n\tif len(keyBytes) != 32 {\n\t\treturn wgtypes.Key{}, fmt.Errorf(\"invalid key length: expected 32 bytes, got %d\", len(keyBytes))\n\t}\n\n\t// Convert to wgtypes.Key\n\tvar key wgtypes.Key\n\tcopy(key[:], keyBytes)\n\n\treturn key, nil\n}\n\nfunc parseStatus(deviceName, ipcStr string) (*Stats, error) {\n\tstats := &Stats{DeviceName: deviceName}\n\tvar currentPeer *Peer\n\tfor _, line := range strings.Split(strings.TrimSpace(ipcStr), \"\\n\") {","sourceCodeStart":496,"sourceCodeEnd":532,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/iface/configurer/usp.go#L496-L532","documentation":"Error \"failed to decode hex key: %w\" thrown in netbirdio/netbird.","triggerScenarios":"Thrown at client/iface/configurer/usp.go:514 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}