redis/redis-py · error · DataError

CLIENT KILL <filter> <value> ... ... <filter> <value> must s

Error message

CLIENT KILL <filter> <value> ... ... <filter> <value> must specify at least one filter

What it means

Raised by client_kill when no filter arguments at all are supplied. The method builds an args list from _id, _type, skipme, addr, laddr, user, maxage; if that list is empty after all checks, it refuses to send a bare CLIENT KILL with no filter, since that would be a server-side protocol error.

Source

Thrown at redis/commands/core.py:798

        if skipme is not None:
            if not isinstance(skipme, bool):
                raise DataError("CLIENT KILL skipme must be a bool")
            if skipme:
                args.extend((b"SKIPME", b"YES"))
            else:
                args.extend((b"SKIPME", b"NO"))
        if _id is not None:
            args.extend((b"ID", _id))
        if addr is not None:
            args.extend((b"ADDR", addr))
        if laddr is not None:
            args.extend((b"LADDR", laddr))
        if user is not None:
            args.extend((b"USER", user))
        if maxage is not None:
            args.extend((b"MAXAGE", maxage))
        if not args:
            raise DataError(
                "CLIENT KILL <filter> <value> ... ... <filter> "
                "<value> must specify at least one filter"
            )
        return self.execute_command("CLIENT KILL", *args, **kwargs)

    @overload
    def client_info(self: SyncClientProtocol, **kwargs) -> dict[str, str | int]: ...

    @overload
    def client_info(
        self: AsyncClientProtocol, **kwargs
    ) -> Awaitable[dict[str, str | int]]: ...

    def client_info(
        self, **kwargs
    ) -> dict[str, str | int] | Awaitable[dict[str, str | int]]:
        """
        Returns information and statistics about the current

View on GitHub (pinned to da03cdc7e8)

Solutions

  1. Supply at least one filter: _id, _type, addr, laddr, user, maxage, or skipme.
  2. If constructing filters dynamically, assert the relevant set is non-empty before calling.
  3. To kill the current client's own connection, pass _id=client_id explicitly.

Example fix

# before
r.client_kill()
# after
r.client_kill(addr='10.0.0.5:6379')
Defensive patterns

Strategy: validation

Validate before calling

filters = {'_id': _id, '_type': _type, 'addr': addr, 'laddr': laddr,
           'user': user, 'maxage': maxage, 'skipme': skipme}
if not any(v is not None for v in filters.values()):
    raise ValueError('At least one client_kill filter must be provided')

Prevention

When it happens

Trigger: Calling r.client_kill() with no arguments. Calling r.client_kill(**{}) from dynamic kwargs that are all None. Passing only kwargs that aren't recognized filter parameters.

Common situations: Building client_kill calls dynamically from a dict where all keys end up None. Migration code that conditionally sets filters but none of the conditions match. Copying a code snippet that omitted the filter argument.

Related errors


AI-assisted analysis of redis/redis-py@da03cdc7e8 (2026-08-04). Data as JSON: /data/errors/6fe8cef343a1ba18.json. Report an issue: GitHub.