infiniflow/ragflow · error · Exception

IP {client_ip} is not allowed by whitelist

Error message

IP {client_ip} is not allowed by whitelist

What it means

Error "IP {client_ip} is not allowed by whitelist" thrown in infiniflow/ragflow.

Source

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

    def _validate_ip_whitelist(security_cfg):
        """Allow only IPs listed in ip_whitelist."""
        whitelist = security_cfg.get("ip_whitelist", [])
        if not whitelist:
            return

        client_ip = request.remote_addr

        for rule in whitelist:
            if "/" in rule:
                # 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)

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Add the client IP to the webhook IP whitelist.
  2. Call the webhook from an allowed network.

Example fix

webhook_config = {'ip_whitelist': ['203.0.113.10']}

When it happens

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

Common situations: A webhook request originates from an IP not present in the configured whitelist, commonly after a client network change; updating the whitelist prevents this error.


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