infiniflow/ragflow · error · Exception

rate_limit.limit must be > 0

Error message

rate_limit.limit must be > 0

What it means

Error "rate_limit.limit must be > 0" thrown in infiniflow/ragflow.

Source

Thrown at api/apps/restful_apis/agent_api.py:1980

                # CIDR notation
                if ipaddress.ip_address(client_ip) in ipaddress.ip_network(rule, strict=False):
                    return
            else:
                # Single IP
                if client_ip == rule:
                    return

        raise Exception(f"IP {client_ip} is not allowed by whitelist")

    def _validate_rate_limit(security_cfg):
        """Simple in-memory rate limiting."""
        rl = security_cfg.get("rate_limit")
        if not rl:
            rl = {"limit": 60, "per": "minute"}

        limit = int(rl.get("limit", 60))
        if limit <= 0:
            raise Exception("rate_limit.limit must be > 0")
        per = rl.get("per", "minute")

        window = {
            "second": 1,
            "minute": 60,
            "hour": 3600,
            "day": 86400,
        }.get(per)

        if not window:
            raise Exception(f"Invalid rate_limit.per: {per}")

        capacity = limit
        rate = limit / window
        cost = 1

        key = f"rl:tb:{agent_id}"
        now = time.time()

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Set rate_limit.limit to a positive integer.

Example fix

webhook_config = {'rate_limit': {'limit': 60, 'per': 'minute'}}

When it happens

Trigger: Thrown at api/apps/restful_apis/agent_api.py:1980 when the library encounters an invalid state.

Common situations: The webhook rate limit is configured with zero or a negative limit; using a positive value prevents this error.


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/0ed55af6f43ecf15. Report an issue: GitHub.