{"record":{"id":"bae7c1f5808de9b5","repo":"redis/node-redis","slug":"hotkeys-get-expected-slot-to-be-a-finite-number","errorCode":null,"errorMessage":"HOTKEYS GET: expected slot to be a finite number, got ${JSON.stringify(value)}","messagePattern":"HOTKEYS GET: expected slot to be a finite number, got (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/client/lib/commands/HOTKEYS_GET.ts","lineNumber":50,"sourceCode":"  allCommandsAllSlotsUs: number;\n  /** Only present when sample-ratio > 1 AND selected-slots is not empty */\n  netBytesSampledCommandsSelectedSlots?: number;\n  /** Only present when selected-slots is not empty */\n  netBytesAllCommandsSelectedSlots?: number;\n  netBytesAllCommandsAllSlots: number;\n  collectionStartTimeUnixMs: number;\n  collectionDurationMs: number;\n  totalCpuTimeSysMs: number;\n  totalCpuTimeUserMs: number;\n  totalNetBytes: number;\n  byCpuTimeUs?: Array<HotkeyEntry>;\n  byNetBytes?: Array<HotkeyEntry>;\n}\n\nfunction toSlotNumber(value: unknown): number {\n  const slot = Number(value);\n  if (!Number.isFinite(slot)) {\n    throw new TypeError(\n      `HOTKEYS GET: expected slot to be a finite number, got ${JSON.stringify(value)}`\n    );\n  }\n  return slot;\n}\n\n/**\n * Parse the hotkeys array into HotkeyEntry objects\n */\nfunction parseHotkeysList(arr: unknown): Array<HotkeyEntry> {\n  return mapLikeEntries(arr).map(([key, value]) => ({\n    key,\n    value: Number(value)\n  }));\n}\n\n/**\n * Parse slot ranges from the server response.","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/redis/node-redis/blob/90fd0652bc3f2a0a1b2f79fa9096b02a86b0ac58/packages/client/lib/commands/HOTKEYS_GET.ts#L32-L68","documentation":"While transforming the HOTKEYS GET reply, a value in the selected-slots field could not be converted to a finite number. The toSlotNumber helper calls Number(value) and rejects non-finite results (NaN, Infinity, non-numeric strings, null). This indicates the server's reply schema differs from what the client expects.","triggerScenarios":"The server's HOTKEYS GET reply contains a selected-slots entry where a slot or slot-range endpoint is non-numeric — null, a string, or an unexpected nested type.","commonSituations":"Redis server version mismatch (older or newer HOTKEYS GET schema); a proxy or intermediary reformatting the reply; server bug producing a malformed selected-slots field.","solutions":["Verify the Redis server version supports HOTKEYS GET with the expected reply schema","Check if a proxy (Twemproxy, Redis Cluster Proxy) is reformatting the reply","Capture the raw reply via sendCommand to inspect the actual selected-slots payload","Report the issue with server version and raw reply for schema investigation"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const reply = await client.hotkeysGet();\n  // process reply\n} catch (e) {\n  if (e instanceof TypeError && e.message.includes('HOTKEYS GET')) {\n    // Server reply schema mismatch — check server version and proxy configuration\n    console.error('HOTKEYS GET reply parsing failed:', e.message);\n  }\n}","preventionTips":["Verify the Redis server version supports HOTKEYS GET with the expected reply schema","Check for proxies or intermediaries that may reformat the reply","Inspect the raw reply via sendCommand(['HOTKEYS','GET']) to diagnose schema differences"],"tags":["command","reply-parsing","version-mismatch","hotkeys"],"backgroundTag":null,"analyzedSha":"90fd0652bc3f2a0a1b2f79fa9096b02a86b0ac58","analyzedAt":"2026-08-11T15:37:21.243Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}