# EXECABORT error

```json metadata
{
  "schema_version": 2,
  "title": "EXECABORT error",
  "description": "A transaction was discarded because one of its commands had an error.",
  "categories": ["docs","develop","stack","oss","rs","rc","oss","kubernetes","clients"],
  "tableOfContents": {"sections":[{"id":"example","title":"Example"},{"id":"how-to-fix-it","title":"How to fix it"}]}

,
  "codeExamples": []
}
```


Redis returns this error from [`EXEC`](https://redis.io/docs/latest/commands/exec) when a command in the transaction couldn't be queued. Redis then discards the whole transaction, so none of its commands run.

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

## Example

Between [`MULTI`](https://redis.io/docs/latest/commands/multi) and `EXEC`, Redis queues each command to run later. A command with an error, such as an unknown command name, is rejected instead of queued. `EXEC` then refuses to run the transaction:

```
> MULTI
OK
> FOO
(error) ERR unknown command 'FOO'
> SET a 1
QUEUED
> EXEC
(error) EXECABORT Transaction discarded because of previous errors.
```

## How to fix it

Look at the reply to each command in the transaction. The command that failed got an error instead of `QUEUED`, and that error tells you what to fix. Common ones are [`ERR unknown command`](https://redis.io/docs/latest/develop/reference/errors/common/err-unknown-command) and [`ERR wrong number of arguments`](https://redis.io/docs/latest/develop/reference/errors/common/err-wrong-number-of-arguments).

If Redis refuses the `EXEC` command itself, the message gives the reason after a colon. For example, when the user isn't allowed to run `EXEC`:

```
EXECABORT Transaction discarded because of: NOPERM User <username> has no permissions to run the 'exec' command
```

In redis-py, a transaction pipeline raises the error of the command that failed, rather than `EXECABORT`. For example: `Command # 1 (FOO) of pipeline caused error: unknown command 'FOO'`.

Errors that happen while `EXEC` runs the commands don't discard the transaction. For example, a [`WRONGTYPE`](https://redis.io/docs/latest/develop/reference/errors/common/wrongtype) error makes only that command fail. The other commands still run, and `EXEC` returns the error in its list of replies. See [Errors inside a transaction](https://redis.io/docs/latest/develop/using-commands/transactions#errors-inside-a-transaction).

