{"record":{"id":"fbdd040c2798420f","repo":"redis/redis-rb","slug":"mode-must-be-silent-fail-or-fatal","errorCode":null,"errorMessage":"mode must be SILENT, FAIL or FATAL","messagePattern":"mode must be SILENT, FAIL or FATAL","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/redis/commands/streams.rb","lineNumber":328,"sourceCode":"      #\n      # @param key   [String]         the stream key\n      # @param group [String]         the consumer group name\n      # @param mode  [String, Symbol] how the entry's delivery counter is\n      #   adjusted: `SILENT` decrements it by one (the delivery \"didn't\n      #   count\"), `FAIL` keeps it unchanged, `FATAL` sets it to the maximum,\n      #   marking the entry permanently failed\n      # @param ids   [Array<String>]  one or multiple entry ids\n      # @param retrycount [Integer]   set the delivery counter to an explicit\n      #   value, overriding the mode adjustment (internal, rarely needed)\n      # @param force [Boolean]        create unowned PEL entries for ids that\n      #   are not currently pending; each must exist in the stream (internal,\n      #   rarely needed)\n      #\n      # @return [Integer] the number of entries released back to the group\n      #   PEL; ids that are not pending are ignored and not counted\n      def xnack(key, group, mode, *ids, retrycount: nil, force: nil)\n        mode = mode.to_s.upcase\n        raise ArgumentError, \"mode must be SILENT, FAIL or FATAL\" unless %w[SILENT FAIL FATAL].include?(mode)\n\n        ids = ids.flatten\n        args = [:xnack, key, group, mode, \"IDS\", ids.size].concat(ids)\n        args << \"RETRYCOUNT\" << Integer(retrycount) if retrycount\n        args << \"FORCE\" if force\n        send_command(args)\n      end\n\n      # Changes the ownership of a pending entry\n      #\n      # @example With splatted entry ids\n      #   redis.xclaim('mystream', 'mygroup', 'consumer1', 3600000, '0-1', '0-2')\n      # @example With arrayed entry ids\n      #   redis.xclaim('mystream', 'mygroup', 'consumer1', 3600000, %w[0-1 0-2])\n      # @example With idle option\n      #   redis.xclaim('mystream', 'mygroup', 'consumer1', 3600000, %w[0-1 0-2], idle: 1000)\n      # @example With time option\n      #   redis.xclaim('mystream', 'mygroup', 'consumer1', 3600000, %w[0-1 0-2], time: 1542866959000)","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/redis/redis-rb/blob/2ba9010b91dab9e0fde1fbae3a9aae003f8bc307/lib/redis/commands/streams.rb#L310-L346","documentation":"Error \"mode must be SILENT, FAIL or FATAL\" thrown in redis/redis-rb.","triggerScenarios":"Thrown at lib/redis/commands/streams.rb:328 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass mode: 'SILENT', 'FAIL' or 'FATAL' (or the matching symbol).","Fix the typo or casing in the mode option value."],"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"}