{"record":{"id":"4f4060ce12024e68","repo":"qishibo/AnotherRedisDesktopManager","slug":"error-message","errorCode":null,"errorMessage":"error.message","messagePattern":"error\\.message","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/components/ConnectionWrapper.vue","lineNumber":189,"sourceCode":"        var clientPromise = redisClient.createConnection(\n          configCopy.host, configCopy.port, configCopy.auth, configCopy,\n        );\n      }\n\n      clientPromise.then((client) => {\n        this.client = client;\n\n        client.on('error', (error) => {\n          this.$message.error({\n            message: `Client On Error: ${error} Config right?`,\n            duration: 3000,\n            customClass: 'redis-on-error-message',\n          });\n\n          this.$bus.$emit('closeConnection');\n        });\n      }).catch((error) => {\n        this.$message.error(error.message);\n        this.$bus.$emit('closeConnection');\n      });\n\n      return clientPromise;\n    },\n    setColor(color, save = true) {\n      const ulDom = this.$refs.connectionMenu.$el;\n      const className = 'menu-with-custom-color';\n\n      // save to setting\n      save && this.$storage.editConnectionItem(this.config, { color });\n\n      if (!color) {\n        ulDom.classList.remove(className);\n      } else {\n        ulDom.classList.add(className);\n        this.$el.style.setProperty('--menu-color', color);\n      }","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/ConnectionWrapper.vue#L171-L207","documentation":"The initial connection promise from redisClient.createConnection(host, port, auth, config) (or createSSHConnection for the ssh branch) rejected, so the connection never established. Classic causes: ECONNREFUSED (wrong host/port or server not listening), ETIMEDOUT (firewalled or unreachable), 'ERR invalid password'/NOAUTH (auth mismatch), TLS mismatch, or bad SSH options. The UI shows the raw message and emits closeConnection.","triggerScenarios":"Typo'd host or port; redis-server not started or bound to 127.0.0.1 while connecting remotely; protected-mode blocking external clients; requirepass set but the saved auth empty; plaintext connection to a TLS port (or vice versa); SSH tunnel credentials or mappings wrong.","commonSituations":"First-time setups, Docker port mappings not published, cloud security groups blocking 6379, rotated passwords in saved configs, rediss:// endpoints used without TLS.","solutions":["Verify reachability outside the app: redis-cli -h <host> -p <port> ping (or nc -vz host port)","Fix host/port and ensure the server binds the right interface with protected-mode handled (bind + requirepass, or bind 127.0.0.1 for local only)","Update the saved auth password to match requirepass/ACL","Match the TLS setting to the endpoint and check SSH options for tunnelled setups"],"exampleFix":"// before\nclientPromise.then((client) => { /* ... */ }).catch((error) => {\n  this.$message.error(error.message);\n  this.$bus.$emit('closeConnection');\n});\n\n// after\nclientPromise.then((client) => { /* ... */ }).catch((error) => {\n  const m = String(error.message);\n  const hint = /ECONNREFUSED/.test(m) ? 'host/port wrong or server down'\n    : /ETIMEDOUT/.test(m) ? 'firewall or unreachable network'\n    : /invalid password|NOAUTH|auth/i.test(m) ? 'wrong password'\n    : m;\n  this.$message.error(`Connect failed: ${hint}`);\n  this.$bus.$emit('closeConnection');\n});","handlingStrategy":"validation","validationCode":"// cheap TCP probe before creating the redis client\nconst net = require('net');\nconst reachable = await new Promise((resolve) => {\n  const s = net.connect({ host, port, timeout: 2000 });\n  s.on('connect', () => { s.destroy(); resolve(true); });\n  s.on('error', () => resolve(false));\n  s.on('timeout', () => { s.destroy(); resolve(false); });\n});\nif (!reachable) {\n  this.$message.error(`${host}:${port} unreachable`);\n  return;\n}","typeGuard":"const isRedisConfigValid = (c) =>\n  Boolean(c) && typeof c.host === 'string' && c.host.length > 0\n  && Number.isInteger(c.port) && c.port > 0 && c.port < 65536;","tryCatchPattern":".catch((error) => {\n  const m = String(error.message);\n  if (/ECONNREFUSED/.test(m)) { /* host/port wrong or server down */ }\n  else if (/ETIMEDOUT/.test(m)) { /* firewall or network */ }\n  else if (/invalid password|NOAUTH/i.test(m)) { /* fix credentials */ }\n  else { this.$message.error(m); }\n  this.$bus.$emit('closeConnection');\n})","preventionTips":["Validate host/port form before connecting","Probe reachability with a short TCP connect to fail fast","Keep saved configs in sync with server auth changes","For TLS endpoints verify cert and port before the client handshake"],"tags":["redis","connection","econnrefused","etimedout","invalid-password","protected-mode"],"backgroundTag":"redis-connection-refused","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}