{"record":{"id":"97ece22f5bd8d0ba","repo":"qishibo/AnotherRedisDesktopManager","slug":"stream-on-error-e-message","errorCode":null,"errorMessage":"Stream On Error: ${e.message}","messagePattern":"Stream On Error: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/components/KeyList.vue","lineNumber":195,"sourceCode":"          }\n        });\n\n        stream.on('error', (e) => {\n          this.resetSearchStatus();\n\n          // scan command disabled, other functions may be used normally\n          if (\n            (e.message.includes('unknown command') && e.message.includes('scan'))\n            || e.message.includes(\"command 'SCAN' is not allowed\")\n          ) {\n            return this.$message.error({\n              message: this.$t('message.scan_disabled'),\n              duration: 1500,\n            });\n          }\n\n          // other errors\n          this.$message.error({\n            message: `Stream On Error: ${e.message}`,\n            duration: 1500,\n          });\n\n          setTimeout(() => {\n            this.$bus.$emit('closeConnection');\n          }, 50);\n        });\n\n        stream.on('end', () => {\n          // all nodes scan finished(cusor back to 0)\n          if (--this.scanningCount <= 0) {\n            this.scanMoreDisabled = true;\n            this.resetSearchStatus();\n          }\n        });\n      });\n    },","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/KeyList.vue#L177-L213","documentation":"The catch-all branch of KeyList.vue's SCAN stream 'error' handler: any stream failure that does not match the known SCAN-disabled signatures prints 'Stream On Error: <e.message>' and then emits closeConnection 50 ms later, tearing down the session. The underlying cause is in e.message - typically a dropped connection mid-scan or a server error reply.","triggerScenarios":"Connection lost while SCAN is streaming a large keyspace (server restart, network blip, SSH tunnel collapse); Redis failover during a scan; proxy or load balancer idle-timeout killing the long-lived scan connection; server returning an error reply mid-cursor.","commonSituations":"Scanning a database with millions of keys over VPN; scan running during a maintenance restart; aggressive proxy timeouts in front of Redis.","solutions":["Read the e.message portion of the toast to identify the real cause (connection reset, server error, etc.).","Reconnect and rescan with a narrower match pattern so the scan finishes faster.","Stabilize the transport for long scans: SSH keepalives, higher proxy idle timeouts, stable VPN."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// cheap liveness check before starting a long scan\nconst alive = await client.ping().then(() => true).catch(() => false);\nif (!alive) return reconnectFirst();","typeGuard":"const isFatalStreamError = (e) => !((e.message.includes('unknown command') && e.message.includes('scan')) || e.message.includes(\"command 'SCAN' is not allowed\"));","tryCatchPattern":"stream.on('error', (e) => {\n  if (isFatalStreamError(e)) {\n    this.$message.error(`Stream On Error: ${e.message}`);\n    this.$bus.$emit('closeConnection'); // app behavior: session torn down\n  }\n});","preventionTips":["Narrow scan match patterns so streams finish before idle timeouts hit.","Enable SSH/TCP keepalives for long scans over tunnels.","Check PING before starting large scans to fail fast on dead connections."],"tags":["scan","stream-error","connection-loss"],"backgroundTag":"connection-lost-during-scan","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}