ERR DISCARD without MULTI: DISCARD without MULTI
RedisWhat 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.
More from this engine
- ERR Lua script attempted to access nonexistent global variableLua script attempted to access a nonexistent global variable
- ERR unknown commandUnknown command
- TRYAGAIN Multiple keys request during rehashing of slotMultiple keys request during rehashing of slot (cluster)
- BUSYGROUP Consumer Group name already existsConsumer group already exists
- NOGROUP No such key or consumer groupNo such key or consumer group in stream
- NOTBUSY No scripts in execution right nowNo scripts in execution right now
- DENIED Redis is running in protected modeRedis is running in protected mode