{"record":{"id":"c8d98f40503d7d91","repo":"redis/redis-rb","slug":"can-t-nest-multi-transaction","errorCode":null,"errorMessage":"Can't nest multi transaction","messagePattern":"Can't nest multi transaction","errorType":"exception","errorClass":"Redis::BaseError","httpStatus":null,"severity":"error","filePath":"lib/redis/pipeline.rb","lineNumber":61,"sourceCode":"        future._set(result)\n      end\n      @futures << future\n      future\n    end\n\n    def send_blocking_command(command, timeout, &block)\n      future = Future.new(command, block, @exception)\n      @pipeline.blocking_call_v(timeout, command) do |result|\n        future._set(result)\n      end\n      @futures << future\n      future\n    end\n  end\n\n  class MultiConnection < PipelinedConnection\n    def multi\n      raise Redis::BaseError, \"Can't nest multi transaction\"\n    end\n\n    private\n\n    # Blocking commands inside transaction behave like non-blocking.\n    # It shouldn't be done though.\n    # https://redis.io/commands/blpop/#blpop-inside-a-multi--exec-transaction\n    def send_blocking_command(command, _timeout, &block)\n      send_command(command, &block)\n    end\n  end\n\n  class FutureNotReady < RuntimeError\n    def initialize\n      super(\"Value will be available once the pipeline executes.\")\n    end\n  end\n","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/redis/redis-rb/blob/2ba9010b91dab9e0fde1fbae3a9aae003f8bc307/lib/redis/pipeline.rb#L43-L79","documentation":"Error \"Can't nest multi transaction\" thrown in redis/redis-rb.","triggerScenarios":"Thrown at lib/redis/pipeline.rb:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not call multi inside an already-open multi block; flatten the transaction into a single multi block.","Refactor nested helper methods so only the outermost one opens the transaction."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2ba9010b91dab9e0fde1fbae3a9aae003f8bc307","analyzedAt":"2026-08-23T03:54:57.017Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}