{"record":{"id":"2a8b6fd9edd0520d","repo":"qishibo/AnotherRedisDesktopManager","slug":"rename-error-e-message","errorCode":null,"errorMessage":"Rename Error: ${e.message}","messagePattern":"Rename Error: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/components/KeyHeader.vue","lineNumber":184,"sourceCode":"          new: this.$util.bufToString(this.keyName),\n        }), {\n          inputValidator: value => ((value == inputTxt) ? true : placeholder),\n          inputPlaceholder: placeholder,\n        }\n      ).then(() => {\n        this.client.rename(this.redisKey, this.keyName).then((reply) => {\n          if (reply === 'OK') {\n            this.$message.success({\n              message: this.$t('message.modify_success'),\n              duration: 1000,\n            });\n\n            this.refreshKeyList(this.redisKey);\n            this.refreshKeyList(this.keyName, 'add');\n            this.$bus.$emit('clickedKey', this.client, this.keyName);\n          }\n        }).catch((e) => {\n          this.$message.error(`Rename Error: ${e.message}`);\n        });\n      }).catch(() => {});\n    },\n    ttlKey() {\n      // -1 persist key\n      if (this.keyTTL == -1) {\n        return this.persistKey();\n      }\n\n      // ttl <= 0\n      if (this.keyTTL <= 0) {\n        this.$confirm(\n          this.$t('message.ttl_delete'),\n          { type: 'warning' },\n        )\n          .then(() => {\n            this.setTTL(true);\n          })","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/KeyHeader.vue#L166-L202","documentation":"KeyHeader.vue rename flow: client.rename(redisKey, keyName) rejection shows 'Rename Error: <e.message>'. Two concrete causes: RENAME is in the app's writeCMD table, so a readonly connection rejects client-side; and the server returns 'ERR no such key' when the SOURCE key no longer exists (RENAME requires an existing source; an existing target is fine - it gets overwritten).","triggerScenarios":"Renaming on a readonly connection (client-side guard); the open key expired or was deleted elsewhere before rename (server 'no such key'); ACL NOPERM for +rename/@write; connection dropped mid-dialog.","commonSituations":"Renaming a short-TTL key after it expired; the key deleted from another session while the tab was open; readonly prod connections.","solutions":["Refresh the key / key list and confirm the source key still exists (EXISTS) before renaming.","If the readonly-mode message appears, disable Readonly and reconnect.","If 'NOPERM', grant +rename to the ACL user."],"exampleFix":"// before\nthis.client.rename(this.redisKey, this.keyName).catch(e => this.$message.error(`Rename Error: ${e.message}`));\n\n// after - verify the source key still exists first\nthis.client.exists(this.redisKey).then((exists) => {\n  if (!exists) { this.$bus.$emit('removePreTab'); return; }\n  return this.client.rename(this.redisKey, this.keyName);\n}).catch(e => this.$message.error(`Rename Error: ${e.message}`));","handlingStrategy":"validation","validationCode":"// source key must exist for RENAME - check first\nconst exists = await client.exists(this.redisKey);\nif (!exists) { this.$bus.$emit('removePreTab'); this.refreshKeyList(this.redisKey); return; }","typeGuard":"const isSourceMissing = (e) => /no such key/i.test(e.message);","tryCatchPattern":"this.client.rename(this.redisKey, this.keyName).catch((e) => {\n  if (isSourceMissing(e)) {\n    // key expired/deleted elsewhere: close the tab, refresh - do not retry the rename\n    this.$bus.$emit('removePreTab');\n  } else if (/readonly mode|NOPERM/i.test(e.message)) {\n    this.$message.error('Rename not permitted (readonly connection or ACL)');\n  } else {\n    this.$message.error(`Rename Error: ${e.message}`);\n  }\n});","preventionTips":["Verify EXISTS on the source key immediately before RENAME - 'ERR no such key' is RENAME's signature failure.","RENAME overwrites an existing target by design; use RENAMENX when overwrite is unwanted."],"tags":["rename","key-not-found","readonly","acl"],"backgroundTag":"redis-key-not-found","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}