# EXECABORT: Transaction discarded after an error

> A command queued during MULTI failed the queue-time check, so EXEC refuses to run any of them and throws the whole transaction away.

Source: https://sqlly.app/errors/redis/execabort
Last updated: 2026-11-30
License: Text and data [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (credit SQLly, sqlly.app); code and SQL snippets [MIT](https://opensource.org/license/mit). [Details](https://sqlly.app/license).
Note: Quoted error message text belongs to its database vendor.

- Error prefix: `EXECABORT`
- Category: Data types and commands

Error message:

```text
EXECABORT Transaction discarded because of previous errors.
```

## What it means

MULTI starts a queue: commands after it are not run, only checked and stacked. If one of them fails the queue-time check, an unknown command or a wrong argument count, Redis remembers the failure, and when EXEC arrives it refuses the entire transaction with EXECABORT instead of running the good commands. Nothing from the queue executes; the client starts over.

Note the split in error timing. Commands that fail at queue time abort the transaction. Commands that fail at run time, such as WRONGTYPE against a key, do not: EXEC still runs the others, and the failed one returns its own error inside the results. The bare reply "EXECABORT Transaction discarded because of previous errors." only means the first kind. A second form, "EXECABORT Transaction discarded because of: <error>", means Redis refused EXEC itself, for example "BUSY Redis is busy running a script" or OOM.

## Common causes

- A queued command had the wrong argument count and failed the arity check when queued.
- A queued command name was misspelled or does not exist on this server.
- A client library building a transaction from user input passed an empty or malformed entry.

## How to fix it

1. Read the error the server reported during MULTI; it names the command that poisoned the queue:

   ```sql
   MULTI
   SET msg hello
   GET
   # (error) ERR wrong number of arguments for 'get' command
   EXEC
   # (error) EXECABORT Transaction discarded because of previous errors.
   ```
2. Discard explicitly when your code detects a bad queue, instead of waiting for EXEC:

   ```sql
   DISCARD
   ```
3. Re-run the transaction once the failing command is fixed; Redis never returns partial results from an aborted one.

## Reproduce it safely

```sql
redis-cli
MULTI
SET msg hello
GET
# Queued, but arity-checked: this one is bad
EXEC
# (error) EXECABORT Transaction discarded because of previous errors.
GET msg
# (nil) - the SET never ran
```

## How SQLly helps

SQLly runs each line as its own command on one connection and shows each reply in order. A server error ends the script at that line, so in this repro the queue-time error is shown and EXEC is never sent; the failing command is visible without reaching for MONITOR.

## Questions

### Did any of my commands run?

No. EXECABORT means the whole queue was discarded. That differs from a run-time error inside EXEC, where the other commands do run.

### Why fail the whole transaction for one bad command?

Queue-time failures are statically checkable: the client sent something structurally wrong. Running the rest would hide the broken call and make the outcome depend on which commands happened to be valid.

## Related errors

- [`ERR wrong number of arguments`](https://sqlly.app/errors/redis/wrong-number-of-arguments): Argument count is wrong
- [`ERR unknown command`](https://sqlly.app/errors/redis/unknown-command): Redis does not know this command
- [`25P02`](https://sqlly.app/errors/postgresql/25P02): PostgreSQL: current transaction is aborted

The code and message text are from the [Redis documentation and source code](https://redis.io/docs/latest/).
