{"record":{"id":"e97031d3dc69ce10","repo":"redis/redis-py","slug":"xclaim-retrycount-must-be-an-integer","errorCode":null,"errorMessage":"XCLAIM retrycount must be an integer","messagePattern":"XCLAIM retrycount must be an integer","errorType":"validation","errorClass":"DataError","httpStatus":null,"severity":"error","filePath":"redis/commands/core.py","lineNumber":7314,"sourceCode":"                \"XCLAIM message_ids must be a non empty list or \"\n                \"tuple of message IDs to claim\"\n            )\n\n        kwargs = {}\n        pieces: list[EncodableT] = [name, groupname, consumername, str(min_idle_time)]\n        pieces.extend(list(message_ids))\n\n        if idle is not None:\n            if not isinstance(idle, int):\n                raise DataError(\"XCLAIM idle must be an integer\")\n            pieces.extend((b\"IDLE\", str(idle)))\n        if time is not None:\n            if not isinstance(time, int):\n                raise DataError(\"XCLAIM time must be an integer\")\n            pieces.extend((b\"TIME\", str(time)))\n        if retrycount is not None:\n            if not isinstance(retrycount, int):\n                raise DataError(\"XCLAIM retrycount must be an integer\")\n            pieces.extend((b\"RETRYCOUNT\", str(retrycount)))\n\n        if force:\n            if not isinstance(force, bool):\n                raise DataError(\"XCLAIM force must be a boolean\")\n            pieces.append(b\"FORCE\")\n        if justid:\n            if not isinstance(justid, bool):\n                raise DataError(\"XCLAIM justid must be a boolean\")\n            pieces.append(b\"JUSTID\")\n            kwargs[\"parse_justid\"] = True\n        return self.execute_command(\"XCLAIM\", *pieces, **kwargs)\n\n    @overload\n    def xdel(self: SyncClientProtocol, name: KeyT, *ids: StreamIdT) -> int: ...\n\n    @overload\n    def xdel(","sourceCodeStart":7296,"sourceCodeEnd":7332,"githubUrl":"https://github.com/redis/redis-py/blob/6a6b581b48225afa0b76912d1028c6035baee932/redis/commands/core.py#L7296-L7332","documentation":"Raised by Redis.xclaim() when the optional retrycount argument is provided and is not an int. retrycount sets the message delivery retry counter. Strict isinstance(int).","triggerScenarios":"Calling r.xclaim(..., retrycount='3') or retrycount=1.0.","commonSituations":"Loading retry count from JSON/config as a string or float.","solutions":["Pass an int for retrycount, or omit it.","Coerce: retrycount = int(retrycount)."],"exampleFix":"# before\nr.xclaim('s','g','c', 0, ['1-0'], retrycount=attempts)  # attempts is float\n\n# after\nr.xclaim('s','g','c', 0, ['1-0'], retrycount=int(attempts))","handlingStrategy":"type-guard","validationCode":"if retrycount is not None and not isinstance(retrycount, int):\n    retrycount = int(retrycount)","typeGuard":"lambda v: v is None or (isinstance(v, int) and not isinstance(v, bool))","tryCatchPattern":"from redis.exceptions import DataError\ntry:\n    r.xclaim('s','g','c', 0, ids, retrycount=rc)\nexcept DataError as e:\n    log.warning('bad xclaim retrycount %r: %s', rc, e)","preventionTips":["Coerce config-sourced counters to int at the boundary."],"tags":["stream","xclaim","validation","type-check"],"backgroundTag":null,"analyzedSha":"6a6b581b48225afa0b76912d1028c6035baee932","analyzedAt":"2026-08-10T12:52:44.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}