{"record":{"id":"0388ddbc200f87f2","repo":"qishibo/AnotherRedisDesktopManager","slug":"expire-error-e-message-0388dd","errorCode":null,"errorMessage":"Expire Error: ${e.message}","messagePattern":"Expire Error: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/components/contents/KeyContentReJson.vue","lineNumber":76,"sourceCode":"            message: this.$t('message.modify_success'),\n            duration: 1000,\n          });\n        } else {\n          this.$message.error({\n            message: this.$t('message.modify_failed'),\n            duration: 1000,\n          });\n        }\n      }).catch((e) => {\n        this.$message.error(e.message);\n      });\n    },\n    setTTL() {\n      const ttl = parseInt(this.$parent.$parent.$refs.keyHeader.keyTTL);\n\n      if (ttl > 0) {\n        this.client.expire(this.redisKey, ttl).catch((e) => {\n          this.$message.error(`Expire Error: ${e.message}`);\n        }).then((reply) => {});\n      }\n    },\n    initShortcut() {\n      this.$shortcut.bind('ctrl+s, ⌘+s', this.hotKeyScope, () => {\n        // make input blur to fill the new value\n        // this.$refs.saveBtn.$el.focus();\n        this.execSave();\n\n        return false;\n      });\n    },\n    dumpCommand() {\n      const command = `JSON.SET ${this.$util.bufToQuotation(this.redisKey)} . ${\n        this.$util.bufToQuotation(this.content)}`;\n      this.$util.copyToClipboard(command);\n      this.$message.success({ message: this.$t('message.copy_success'), duration: 800 });\n    },","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/contents/KeyContentReJson.vue#L58-L94","documentation":"After a successful JSON.SET the component re-applies the header TTL with EXPIRE; this catch fires when that EXPIRE fails. The TTL value itself is rarely the problem — failures are connection-level ('Stream isn't writeable and enableOfflineQueue options is false', closed socket) or ACL denials. A vanished key is not an error here: EXPIRE resolves 0, and this code ignores the reply.","triggerScenarios":"Connection dropping immediately after JSON.SET; the ioredis client already in 'end' status when setTTL runs (tab closed concurrently); ACL user without expire/@keyspace permission.","commonSituations":"Flaky links to managed Redis; TTL re-application racing a disconnect; least-privilege ACL service accounts that forgot @keyspace.","solutions":["Guard with client.status === 'ready' before issuing EXPIRE, or reconnect first","Grant the ACL user expire or the @keyspace category","Afterwards confirm with TTL key that the expiry actually applied — the code path ignores a 0 reply"],"exampleFix":"// before\nthis.client.expire(this.redisKey, ttl).catch((e) => {\n  this.$message.error(`Expire Error: ${e.message}`);\n});\n\n// after\nif (this.client.status === 'ready') {\n  this.client.expire(this.redisKey, ttl).catch((e) => {\n    this.$message.error(`Expire Error: ${e.message}`);\n  });\n}","handlingStrategy":"try-catch","validationCode":"if (this.client.status !== 'ready') {\n  return; // do not fire EXPIRE into a dead client\n}","typeGuard":null,"tryCatchPattern":"client.expire(key, ttl)\n  .then((reply) => {\n    if (reply === 0) {\n      // key vanished between write and expire — not an error, but TTL was not set\n      this.$message.warning('Key disappeared before TTL could be set');\n    }\n  })\n  .catch((e) => this.$message.error(`Expire Error: ${e.message}`));","preventionTips":["Check client.status before follow-up commands like EXPIRE after a primary write","Inspect the EXPIRE reply: 0 means the key is gone, which silent .then(() => {}) hides","On unstable links, batch the write and TTL (MULTI) so both land or neither"],"tags":["redis","ioredis","expire","ttl","redisjson"],"backgroundTag":"redis-command-error","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}