DBAtlas · Database operations atlas

ERR DISCARD without MULTI: DISCARD without MULTI

Redis

What does it mean?

DISCARD was sent while no MULTI block was open. DISCARD is used only to cancel an in-progress transaction; it returns this error when there is nothing to cancel.

Why does it happen?

Calling DISCARD without MULTI, or again after the transaction was already closed with EXEC/DISCARD; an unconditional DISCARD call in error handling code; or the connection state differing from what is expected (MULTI is not open on the connection taken from the pool).

How to fix it

Call DISCARD only when a MULTI is actually open; track transaction state in code. In error handlers, check whether a transaction is open before calling DISCARD. Use your library's transaction wrapper so it manages the state automatically. Guarantee a clean state in the connection pool.

Open in DBAtlas →

More from this engine