{"record":{"id":"49e4bb016b456fb2","repo":"qishibo/AnotherRedisDesktopManager","slug":"memory-analysis-stream-on-error-e-messag","errorCode":null,"errorMessage":"Memory Analysis Stream On Error: ${e.messag}","messagePattern":"Memory Analysis Stream On Error: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/components/MemoryAnalysis.vue","lineNumber":152,"sourceCode":"          const keysWithMemory = [];\n          const promise = this.initKeysMemory(keys, keysWithMemory);\n\n          promise.then(() => {\n            // add interval between rendering\n            setTimeout(() => {\n              this.keysList = this.keysList.concat(keysWithMemory);\n              this.reOrder('desc');\n              this.isScanning && stream.resume();\n            }, 100);\n\n            // size count\n            this.totalSize += keysWithMemory.reduce((sum, item) => sum + parseInt(item.size), 0);\n          });\n        });\n\n        stream.on('error', (e) => {\n          this.toggleScanning(true);\n          this.$message.error(`Memory Analysis Stream On Error: ${e.messag}`);\n        });\n\n        stream.on('end', () => {\n          // all nodes scan finished(cusor back to 0)\n          if (--this.scanningCount <= 0) {\n            this.isScanning = false;\n            this.scanningEnd = true;\n          }\n        });\n      });\n    },\n    // todo: should avoid logging too many commands!\n    initKeysMemory(keys, keysWithMemory) {\n      if (!keys) {\n        return;\n      }\n\n      const allPromise = [];","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/MemoryAnalysis.vue#L134-L170","documentation":"Catch-all for the memory-analysis scan stream in MemoryAnalysis.vue (SCAN + MEMORY USAGE per key). Note two distinct things: (1) MEMORY USAGE requires Redis 4.0+ - on older servers the stream errors with \"unknown command 'MEMORY'\", and a dropped connection also lands here; (2) the template has a typo - '${e.messag}' instead of '${e.message}' - so the toast always ends in 'undefined' and hides the real cause.","triggerScenarios":"Running memory analysis against Redis < 4.0 (no MEMORY command); a proxy or managed layer that does not forward MEMORY; SSH tunnel or connection collapsing during a long analysis; huge keyspaces where the stream runs for minutes.","commonSituations":"Analyzing legacy Redis 3.x instances; long analyses over VPN/SSH that get cut by idle timeouts; restricted managed environments.","solutions":["Check the server version first (INFO server / client.info()) - MEMORY USAGE needs Redis >= 4.0.","Fix the typo e.messag -> e.message so the real error text is visible.","If a proxy blocks MEMORY, connect directly to a node; if the tunnel drops, stabilize it (keepalives) and rerun."],"exampleFix":"// before\nthis.$message.error(`Memory Analysis Stream On Error: ${e.messag}`); // prints 'undefined'\n\n// after\nthis.$message.error(`Memory Analysis Stream On Error: ${e.message}`);","handlingStrategy":"validation","validationCode":"// MEMORY USAGE requires Redis 4.0 - check before starting analysis\nconst info = await client.info('server');\nconst version = /redis_version:([\\d.]+)/.exec(info)[1];\nif (Number(version.split('.')[0]) < 4) {\n  throw new Error(`Memory Analysis needs Redis >= 4.0, server is ${version}`);\n}","typeGuard":"const isVersionError = (e) => /unknown command.*MEMORY/i.test(e.message);","tryCatchPattern":"stream.on('error', (e) => {\n  this.toggleScanning(true);\n  // note: the shipped template prints e.messag ('undefined') - use e.message\n  this.$message.error(`Memory Analysis Stream On Error: ${e.message}`);\n});","preventionTips":["Always print e.message (the current template's e.messag typo hides the cause).","Gate the memory-analysis feature on a server version check (>= 4.0).","Stabilize tunnels for long analyses - mid-stream disconnects land in the same handler."],"tags":["memory-usage","redis-version","typo","stream-error"],"backgroundTag":"redis-version-unsupported","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}