{"record":{"id":"8bd6f185858022b3","repo":"redis/redis-rb","slug":"wrong-number-of-arguments-given-args-size-2","errorCode":null,"errorMessage":"wrong number of arguments (given #{args.size + 2}, expected 2, 5 or 6)","messagePattern":"wrong number of arguments \\(given #(.+?), expected 2, 5 or 6\\)","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/redis/commands/streams.rb","lineNumber":441,"sourceCode":"      # @param key      [String]  the stream key\n      # @param group    [String]  the consumer group name\n      # @param start    [String]  start first entry id of range\n      # @param end      [String]  end   last entry id of range\n      # @param count    [Integer] count the number of entries as limit\n      # @param consumer [String]  the consumer name\n      #\n      # @option opts [Integer] :idle       pending message minimum idle time in milliseconds\n      #\n      # @return [Hash]        the summary of pending entries\n      # @return [Array<Hash>] the pending entries details if options were specified\n      def xpending(key, group, *args, idle: nil)\n        command_args = [:xpending, key, group]\n        command_args << 'IDLE' << Integer(idle) if idle\n        case args.size\n        when 0, 3, 4\n          command_args.concat(args)\n        else\n          raise ArgumentError, \"wrong number of arguments (given #{args.size + 2}, expected 2, 5 or 6)\"\n        end\n\n        summary_needed = args.empty?\n        blk = summary_needed ? HashifyStreamPendings : HashifyStreamPendingDetails\n        send_command(command_args, &blk)\n      end\n\n      private\n\n      def _xread(args, keys, ids, blocking_timeout_msec)\n        keys = keys.is_a?(Array) ? keys : [keys]\n        ids = ids.is_a?(Array) ? ids : [ids]\n        args << 'STREAMS'\n        args.concat(keys)\n        args.concat(ids)\n\n        if blocking_timeout_msec.nil?\n          send_command(args, &HashifyStreams)","sourceCodeStart":423,"sourceCodeEnd":459,"githubUrl":"https://github.com/redis/redis-rb/blob/2ba9010b91dab9e0fde1fbae3a9aae003f8bc307/lib/redis/commands/streams.rb#L423-L459","documentation":"Error \"wrong number of arguments (given #{args.size + 2}, expected 2, 5 or 6)\" thrown in redis/redis-rb.","triggerScenarios":"Thrown at lib/redis/commands/streams.rb:441 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call the method with 2, 5 or 6 total arguments as documented; the given count is not supported.","Check the method signature and remove or add arguments to match one of the allowed arities."],"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"}