{"record":{"id":"d5a72573c65acb13","repo":"qishibo/AnotherRedisDesktopManager","slug":"e-message-d5a725","errorCode":null,"errorMessage":"e.message","messagePattern":"e\\.message","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/components/ConnectionMenu.vue","lineNumber":390,"sourceCode":"      const preDB = this.client.condition ? this.client.condition.select : 0;\n      const inputTxt = 'y';\n      const placeholder = this.$t('message.flushdb_prompt', { txt: inputTxt });\n\n      this.$prompt(this.$t('message.confirm_flush_db', { db: preDB }), {\n        inputValidator: value => ((value == inputTxt) ? true : placeholder),\n        inputPlaceholder: placeholder,\n      })\n        .then((value) => {\n          this.client.flushdb().then((reply) => {\n            if (reply == 'OK') {\n              this.$message.success({\n                message: this.$t('message.delete_success'),\n                duration: 1000,\n              });\n\n              this.refreshConnection();\n            }\n          }).catch((e) => { this.$message.error(e.message); });\n        })\n        .catch((e) => {});\n    },\n    changeColor(color) {\n      this.$emit('changeColor', color);\n    },\n  },\n};\n</script>\n\n<style type=\"text/css\">\n  .connection-menu-title {\n    margin-left: -20px;\n  }\n\n  .connection-menu .connection-name {\n    margin-right: 115px;\n    padding-right: 6px;","sourceCodeStart":372,"sourceCodeEnd":408,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/ConnectionMenu.vue#L372-L408","documentation":"FLUSHDB confirmation flow in ConnectionMenu.vue: after the user confirms, client.flushdb() rejection surfaces the raw e.message. FLUSHDB is in the app's writeCMD table, so on a readonly connection the client-side guard rejects before the server is contacted; other causes are ACL denial (NOPERM for @dangerous/@write), managed Redis blocking FLUSHDB, or a dropped connection.","triggerScenarios":"Connection readonly guard (FLUSHDB is intercepted in sendCommand); ACL user without @dangerous/@write; managed services (ElastiCache, Upstash, etc.) that disable FLUSHDB; connection lost between confirm and execution.","commonSituations":"Attempting to flush a production DB from a readonly-configured connection; restricted ACL accounts; managed instances with command blacklists.","solutions":["If the message is the readonly-mode text, disable Readonly in the connection config and reconnect (intentionally dangerous).","If the message is 'NOPERM', grant the ACL user @dangerous (or +flushdb) or use an admin account.","On managed Redis that blocks FLUSHDB entirely, delete keys via scan + UNLINK or use the provider's console."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { writeCMD } from '@/commands.js';\n// readonly guard + confirm before FLUSHDB\nif (client.options.connectionReadOnly && writeCMD['FLUSHDB']) {\n  throw new Error('Connection is readonly - FLUSHDB is blocked client-side');\n}","typeGuard":"const isPermissionError = (e) => /NOPERM|readonly mode|not allowed/i.test(e.message);","tryCatchPattern":"this.client.flushdb().then(/* success */).catch((e) => {\n  if (isPermissionError(e)) {\n    this.$message.error('FLUSHDB not permitted on this connection/server - check readonly setting and ACL');\n  } else {\n    this.$message.error(e.message);\n  }\n});","preventionTips":["Gate the Flush DB menu item on !client.options.connectionReadOnly.","For managed Redis, verify FLUSHDB support before offering the action.","Require the confirmation prompt value (the app already does) - it is the last line of defense."],"tags":["flushdb","readonly","acl","dangerous-command","managed-redis"],"backgroundTag":"redis-permission-denied","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}