infiniflow/ragflow · error · Exception
Rate limit error: {e}
Error message
Rate limit error: {e} What it means
Error "Rate limit error: {e}" thrown in infiniflow/ragflow.
Source
Thrown at api/apps/restful_apis/agent_api.py:2014
key = f"rl:tb:{agent_id}"
now = time.time()
try:
from rag.utils.redis_conn import REDIS_CONN
res = REDIS_CONN.lua_token_bucket(
keys=[key],
args=[capacity, rate, now, cost],
client=REDIS_CONN.REDIS,
)
allowed = int(res[0])
if allowed != 1:
raise Exception("Too many requests (rate limit exceeded)")
except Exception as e:
raise Exception(f"Rate limit error: {e}")
def _validate_token_auth(security_cfg):
"""Validate header-based token authentication."""
token_cfg = security_cfg.get("token", {})
header = token_cfg.get("token_header")
token_value = token_cfg.get("token_value")
provided = request.headers.get(header)
if provided != token_value:
raise Exception("Invalid token authentication")
def _validate_basic_auth(security_cfg):
"""Validate HTTP Basic Auth credentials."""
auth_cfg = security_cfg.get("basic_auth", {})
username = auth_cfg.get("username")
password = auth_cfg.get("password")
auth = request.authorizationView on GitHub (pinned to 554fb1133a)
Solutions
- Check the rate limiter backend (e.g. Redis) is reachable and healthy.
- Inspect the logged underlying error for the root cause.
Example fix
# verify Redis connectivity used by the rate limiter redis-cli ping
When it happens
Trigger: Thrown at api/apps/restful_apis/agent_api.py:2014 when the library encounters an invalid state.
Common situations: The rate limiting component fails internally, typically due to an unavailable backing store; restoring the backend service prevents this error.
AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15).
Data as JSON: /api/errors/9a11bd58d9888c8e.
Report an issue: GitHub.