{"record":{"id":"62f973d4b1ec7a85","repo":"qishibo/AnotherRedisDesktopManager","slug":"message-this-t-message-test-connection-failed","errorCode":null,"errorMessage":"message || this.$t('message.test_connection_failed')","messagePattern":"message \\|\\| this\\.\\$t\\('message\\.test_connection_failed'\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/components/NewConnectionDialog.vue","lineNumber":422,"sourceCode":"        this.testClient.disconnect(false);\n      } catch (e) {}\n      this.testClient = null;\n    },\n    // ok: true / false; omit ok for cancel (cleanup only, no toast)\n    finishTest(ok, message) {\n      if (!this.testing) {\n        return;\n      }\n      this.testing = false;\n\n      clearTimeout(this.testTimer);\n      this.cleanupTestClient();\n\n      // except ok == null\n      if (ok === true) {\n        this.$message.success(this.$t('message.test_connection_success'));\n      } else if (ok === false) {\n        this.$message.error(message || this.$t('message.test_connection_failed'));\n      }\n    },\n    testConnection() {\n      if (this.testing) {\n        return;\n      }\n\n      const config = this.getConnectionConfig();\n      if (!config) {\n        return;\n      }\n\n      this.testing = true;\n      this.testClient = null;\n\n      // show timeout message after N seconds\n      this.testTimer = setTimeout(() => {\n        this.finishTest(false, this.$t('message.test_connection_timeout'));","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/NewConnectionDialog.vue#L404-L440","documentation":"Toast emitted by finishTest(false, message) when a test connection fails: redisClient.createConnection/createSSHConnection rejected, the ioredis client emitted 'error' before 'ready', or the post-ready PING failed (NewConnectionDialog.vue:461-473). 'message || fallback' means the raw ioredis error text ('Connection refused', 'WRONGPASS invalid username-password pair', TLS errors) is shown when present, else the generic localized message.","triggerScenarios":"Wrong host/port (ECONNREFUSED), wrong or missing password (WRONGPASS/NOAUTH), SSL enabled against a plaintext port or vice versa, unreachable SSH tunnel/bastion, server in protected mode, ACL username/password mismatch - any failure that rejects before the 5-second timer fires.","commonSituations":"Typo'd port, password rotated after the config was saved, TLS mismatch on managed instances (ElastiCache/Upstash), changed SSH key, client IP outside the VPC/security group.","solutions":["Read the specific message text - it distinguishes TCP refusal, auth failure, and TLS errors","Verify reachability from the same machine: redis-cli -h <host> -p <port> ping (add --tls for TLS endpoints)","Re-enter the auth password / ACL username+password","Match the SSL toggle and SSH settings to the server's actual configuration"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// cheap TCP preflight before the full client handshake (node)\nconst net = require('net');\n\nfunction tcpReachable(host, port, timeoutMs = 2000) {\n  return new Promise((resolve) => {\n    const s = net.connect({ host, port });\n    s.setTimeout(timeoutMs, () => { s.destroy(); resolve(false); });\n    s.once('connect', () => { s.destroy(); resolve(true); });\n    s.once('error', () => resolve(false));\n  });\n}","typeGuard":null,"tryCatchPattern":"// every path in the test flow funnels into one finish handler - keep that shape\nredisClient.createConnection(host, port, auth, config)\n  .then((client) => new Promise((resolve, reject) => {\n    client.once('ready', () => client.ping().then(resolve, reject));\n    client.once('error', reject);\n  }))\n  .catch((e) => {\n    // surface the raw message: it discriminates auth vs TCP vs TLS causes\n    showError(e.message || 'test connection failed');\n  });","preventionTips":["Always show e.message - the fallback hides the actual cause","Keep auth/SSL/SSH settings in the saved profile in sync with server-side changes","Verify reachability with redis-cli from the same machine before debugging the app"],"tags":["redis","ioredis","connection","authentication","ardm"],"backgroundTag":"redis-connection-failed","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}