{"record":{"id":"0ed55af6f43ecf15","repo":"infiniflow/ragflow","slug":"rate-limit-limit-must-be-0","errorCode":null,"errorMessage":"rate_limit.limit must be > 0","messagePattern":"rate_limit\\.limit must be > 0","errorType":"exception","errorClass":"Exception","httpStatus":400,"severity":"error","filePath":"api/apps/restful_apis/agent_api.py","lineNumber":1980,"sourceCode":"                # CIDR notation\n                if ipaddress.ip_address(client_ip) in ipaddress.ip_network(rule, strict=False):\n                    return\n            else:\n                # Single IP\n                if client_ip == rule:\n                    return\n\n        raise Exception(f\"IP {client_ip} is not allowed by whitelist\")\n\n    def _validate_rate_limit(security_cfg):\n        \"\"\"Simple in-memory rate limiting.\"\"\"\n        rl = security_cfg.get(\"rate_limit\")\n        if not rl:\n            rl = {\"limit\": 60, \"per\": \"minute\"}\n\n        limit = int(rl.get(\"limit\", 60))\n        if limit <= 0:\n            raise Exception(\"rate_limit.limit must be > 0\")\n        per = rl.get(\"per\", \"minute\")\n\n        window = {\n            \"second\": 1,\n            \"minute\": 60,\n            \"hour\": 3600,\n            \"day\": 86400,\n        }.get(per)\n\n        if not window:\n            raise Exception(f\"Invalid rate_limit.per: {per}\")\n\n        capacity = limit\n        rate = limit / window\n        cost = 1\n\n        key = f\"rl:tb:{agent_id}\"\n        now = time.time()","sourceCodeStart":1962,"sourceCodeEnd":1998,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/api/apps/restful_apis/agent_api.py#L1962-L1998","documentation":"Error \"rate_limit.limit must be > 0\" thrown in infiniflow/ragflow.","triggerScenarios":"Thrown at api/apps/restful_apis/agent_api.py:1980 when the library encounters an invalid state.","commonSituations":"The webhook rate limit is configured with zero or a negative limit; using a positive value prevents this error.","solutions":["Set rate_limit.limit to a positive integer."],"exampleFix":"webhook_config = {'rate_limit': {'limit': 60, 'per': 'minute'}}","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}