qishibo/AnotherRedisDesktopManager · warning

(error) ERR DISCARD without MULTI

Error message

(error) ERR DISCARD without MULTI

What it means

CliTab keeps MULTI/EXEC state locally: typing MULTI sets multiQueue = [], and only while it is an Array are commands queued. DISCARD typed when multiQueue is null makes the CLI echo the exact string real Redis returns - '(error) ERR DISCARD without MULTI' - entirely client-side; no command reaches the server.

Source

Thrown at src/components/CliTab.vue:222

        return this.content = [];
      }

      // mock help command
      if (paramsArr[0] == 'help') {
        return this.scrollToBottom('Input your command and select from tips');
      }

      // multi-exec mode
      if (paramsArr[0] == 'multi') {
        this.multiQueue = [];
        return this.scrollToBottom('OK');
      }

      // multi-discard-mode
      if (paramsArr[0] == 'discard') {
      // discard when not multi condition
        if (!Array.isArray(this.multiQueue)) {
          return this.scrollToBottom('(error) ERR DISCARD without MULTI');
        }
        this.multiQueue = null;
        return this.scrollToBottom('OK');
      }

      // multi dequeue
      if (paramsArr[0] == 'exec') {
        // exec when not multi condition
        if (!Array.isArray(this.multiQueue)) {
          return this.scrollToBottom('(error) ERR EXEC without MULTI');
        }

        this.anoClient.multi(this.multiQueue).execBuffer((err, reply) => {
          if (err) {
            this.content.push(`${err}`);
          } else {
            this.content.push(this.resolveResult(reply).trim());
          }

View on GitHub (pinned to c149855106)

Solutions

  1. Start the transaction with MULTI before using DISCARD
  2. Check earlier terminal output - a previous EXEC/DISCARD or a failed command already closed the transaction
  3. Re-run the intended MULTI block from the beginning

Example fix

// guard the CLI input before dispatching
if (paramsArr[0] === 'discard' && !Array.isArray(this.multiQueue)) {
  return this.scrollToBottom('hint: no MULTI in progress, type MULTI first');
}
Defensive patterns

Strategy: validation

Validate before calling

// validate local transaction state before echoing a server-style error
function canDiscard(multiQueue) {
  return Array.isArray(multiQueue);
}

if (paramsArr[0] === 'discard' && !canDiscard(this.multiQueue)) {
  return this.scrollToBottom('no MULTI in progress - type MULTI first');
}

Prevention

When it happens

Trigger: Typing DISCARD before any MULTI in the workbench CLI; after a previous EXEC or DISCARD already reset the queue to null; or after an errored command whose .catch set multiQueue = null (CliTab.vue:282).

Common situations: Pasting a transaction script twice (the second DISCARD fails), a failed command aborting the local queue, mixed habits between manual MULTI and one-shot commands.

Related errors


AI-assisted analysis of qishibo/AnotherRedisDesktopManager@c149855106 (2026-08-22). Data as JSON: /api/errors/fb6d8af7893cc01e. Report an issue: GitHub.