{"record":{"id":"6fe8cef343a1ba18","repo":"redis/redis-py","slug":"client-kill-filter-value-filter-val","errorCode":null,"errorMessage":"CLIENT KILL <filter> <value> ... ... <filter> <value> must specify at least one filter","messagePattern":"CLIENT KILL <filter> <value> \\.\\.\\. \\.\\.\\. <filter> <value> must specify at least one filter","errorType":"exception","errorClass":"DataError","httpStatus":null,"severity":"error","filePath":"redis/commands/core.py","lineNumber":798,"sourceCode":"        if skipme is not None:\n            if not isinstance(skipme, bool):\n                raise DataError(\"CLIENT KILL skipme must be a bool\")\n            if skipme:\n                args.extend((b\"SKIPME\", b\"YES\"))\n            else:\n                args.extend((b\"SKIPME\", b\"NO\"))\n        if _id is not None:\n            args.extend((b\"ID\", _id))\n        if addr is not None:\n            args.extend((b\"ADDR\", addr))\n        if laddr is not None:\n            args.extend((b\"LADDR\", laddr))\n        if user is not None:\n            args.extend((b\"USER\", user))\n        if maxage is not None:\n            args.extend((b\"MAXAGE\", maxage))\n        if not args:\n            raise DataError(\n                \"CLIENT KILL <filter> <value> ... ... <filter> \"\n                \"<value> must specify at least one filter\"\n            )\n        return self.execute_command(\"CLIENT KILL\", *args, **kwargs)\n\n    @overload\n    def client_info(self: SyncClientProtocol, **kwargs) -> dict[str, str | int]: ...\n\n    @overload\n    def client_info(\n        self: AsyncClientProtocol, **kwargs\n    ) -> Awaitable[dict[str, str | int]]: ...\n\n    def client_info(\n        self, **kwargs\n    ) -> dict[str, str | int] | Awaitable[dict[str, str | int]]:\n        \"\"\"\n        Returns information and statistics about the current","sourceCodeStart":780,"sourceCodeEnd":816,"githubUrl":"https://github.com/redis/redis-py/blob/6a6b581b48225afa0b76912d1028c6035baee932/redis/commands/core.py#L780-L816","documentation":"Raised by client_kill() (redis/commands/core.py:798) when every filter argument (_type, skipme, _id, addr, laddr, user, maxage) is None, leaving the assembled args list empty. CLIENT KILL with no filters is meaningless at the protocol level, so the library refuses to send it. This is a redis.exceptions.DataError raised before any command is sent.","triggerScenarios":"Calling r.client_kill() with no arguments, or r.client_kill(_id=None, addr=None) where all filters resolve to None. Because each filter is checked with 'is not None', passing an explicit None for every argument still triggers it.","commonSituations":"Calling client_kill() expecting it to kill all clients or the current client; or conditionally building filters that all evaluate to None at runtime (e.g. all config-driven filters happen to be unset).","solutions":["Supply at least one filter, e.g. r.client_kill(_id=client_id) or r.client_kill(addr=\"1.2.3.4:1234\")","To kill the current connection, use r.client_id() to obtain the id then r.client_kill(_id=that_id)","To kill by type, pass _type=\"normal\" (also accepted: master, replica, pubsub)"],"exampleFix":"# before\nr.client_kill()\n# after\nr.client_kill(_id=r.client_id())","handlingStrategy":"validation","validationCode":"filters = {\"_id\": _id, \"addr\": addr, \"_type\": _type, \"user\": user}\nprovided = {k: v for k, v in filters.items() if v is not None}\nif not provided:\n    raise ValueError(\"supply at least one CLIENT KILL filter\")\nr.client_kill(**provided)","typeGuard":null,"tryCatchPattern":"from redis.exceptions import DataError\ntry:\n    r.client_kill(**filters)\nexcept DataError as e:\n    if \"at least one filter\" in str(e):\n        # nothing to kill; treat as no-op\n        pass\n    else:\n        raise","preventionTips":["Always target a concrete client (id/addr) or a type when calling client_kill.","Build the filter dict from non-None values and check it is non-empty before calling.","Avoid 'kill everything' patterns; the protocol does not support them."],"tags":["client-management","validation","dataerror"],"backgroundTag":null,"analyzedSha":"6a6b581b48225afa0b76912d1028c6035baee932","analyzedAt":"2026-08-10T12:52:44.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}