redis/redis-rb · error · ArgumentError

mode must be SILENT, FAIL or FATAL

Error message

mode must be SILENT, FAIL or FATAL

What it means

Error "mode must be SILENT, FAIL or FATAL" thrown in redis/redis-rb.

Source

Thrown at lib/redis/commands/streams.rb:328

      #
      # @param key   [String]         the stream key
      # @param group [String]         the consumer group name
      # @param mode  [String, Symbol] how the entry's delivery counter is
      #   adjusted: `SILENT` decrements it by one (the delivery "didn't
      #   count"), `FAIL` keeps it unchanged, `FATAL` sets it to the maximum,
      #   marking the entry permanently failed
      # @param ids   [Array<String>]  one or multiple entry ids
      # @param retrycount [Integer]   set the delivery counter to an explicit
      #   value, overriding the mode adjustment (internal, rarely needed)
      # @param force [Boolean]        create unowned PEL entries for ids that
      #   are not currently pending; each must exist in the stream (internal,
      #   rarely needed)
      #
      # @return [Integer] the number of entries released back to the group
      #   PEL; ids that are not pending are ignored and not counted
      def xnack(key, group, mode, *ids, retrycount: nil, force: nil)
        mode = mode.to_s.upcase
        raise ArgumentError, "mode must be SILENT, FAIL or FATAL" unless %w[SILENT FAIL FATAL].include?(mode)

        ids = ids.flatten
        args = [:xnack, key, group, mode, "IDS", ids.size].concat(ids)
        args << "RETRYCOUNT" << Integer(retrycount) if retrycount
        args << "FORCE" if force
        send_command(args)
      end

      # Changes the ownership of a pending entry
      #
      # @example With splatted entry ids
      #   redis.xclaim('mystream', 'mygroup', 'consumer1', 3600000, '0-1', '0-2')
      # @example With arrayed entry ids
      #   redis.xclaim('mystream', 'mygroup', 'consumer1', 3600000, %w[0-1 0-2])
      # @example With idle option
      #   redis.xclaim('mystream', 'mygroup', 'consumer1', 3600000, %w[0-1 0-2], idle: 1000)
      # @example With time option
      #   redis.xclaim('mystream', 'mygroup', 'consumer1', 3600000, %w[0-1 0-2], time: 1542866959000)

View on GitHub (pinned to 2ba9010b91)

Solutions

  1. Pass mode: 'SILENT', 'FAIL' or 'FATAL' (or the matching symbol).
  2. Fix the typo or casing in the mode option value.

When it happens

Trigger: Thrown at lib/redis/commands/streams.rb:328 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of redis/redis-rb@2ba9010b91 (2026-08-23). Data as JSON: /api/errors/fbdd040c2798420f. Report an issue: GitHub.