ERR MULTI calls can not be nested: MULTI calls can not be nested
RedisWhat does it mean?
MULTI was sent again while a MULTI (transaction) block was already open. Redis does not support nested transaction blocks; only one MULTI can be active at a time.
Why does it happen?
Application logic starting a new MULTI without closing the previous one with EXEC/DISCARD; reusing the same connection from a connection pool without properly resetting the transaction state; or a library wrapper unknowingly calling MULTI twice.
How to fix it
Close every MULTI block with a single EXEC (or DISCARD to cancel) and open a new block only after finishing the previous one. Clearly separate transaction start/end in the code flow. Make sure no transaction is left open before returning a connection to the pool. If nested logic is required, consider doing the atomic operation with a Lua script (EVAL).
More from this engine
- ERR Can't save in background: fork failedBackground save failed: fork failed
- NOPROTO unsupported protocol versionUnsupported RESP protocol version
- ERR Unknown option or number of arguments for CONFIG SETUnknown option or number of arguments for CONFIG SET (older versions: Unsupported CONFIG parameter)
- 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)
- ERR DISCARD without MULTIDISCARD without MULTI