{"record":{"id":"523dafe71b385ca1","repo":"cocoindex-io/cocoindex","slug":"invalid-response-text-200","errorCode":null,"errorMessage":"Invalid response: {text[:200]}","messagePattern":"Invalid response: (.+?)","errorType":"exception","errorClass":"DorisStreamLoadError","httpStatus":null,"severity":"error","filePath":"python/cocoindex/connectors/doris/_target.py","lineNumber":649,"sourceCode":"                status_code, _, text = await _send(rewritten)\n        else:\n            async with session.put(\n                url, data=data, headers=headers, timeout=load_timeout\n            ) as response:\n                status_code = response.status\n                text = await response.text()\n\n        if status_code in (401, 403):\n            raise DorisAuthError(\n                f\"Authentication failed: HTTP {status_code}\",\n                host=config.fe_host,\n                port=config.fe_http_port,\n            )\n\n        try:\n            result: dict[str, Any] = json.loads(text)\n        except json.JSONDecodeError:\n            raise DorisStreamLoadError(\n                f\"Invalid response: {text[:200]}\", status=\"ParseError\"\n            )\n\n        load_status = result.get(\"Status\", \"Unknown\")\n        if load_status not in (\"Success\", \"Publish Timeout\"):\n            raise DorisStreamLoadError(\n                result.get(\"Message\", \"Unknown error\"),\n                status=load_status,\n                error_url=result.get(\"ErrorURL\"),\n                loaded_rows=result.get(\"NumberLoadedRows\", 0),\n                filtered_rows=result.get(\"NumberFilteredRows\", 0),\n            )\n        return result\n\n    retry_config = RetryConfig(\n        max_retries=config.max_retries,\n        base_delay=config.retry_base_delay,\n        max_delay=config.retry_max_delay,","sourceCodeStart":631,"sourceCodeEnd":667,"githubUrl":"https://github.com/cocoindex-io/cocoindex/blob/e84aa99b3292c5270a4b313b2a7137ad9ce8ab3b/python/cocoindex/connectors/doris/_target.py#L631-L667","documentation":"After a stream load, the connector expects the FE/BE response body to be JSON (per Doris stream load protocol). If the body is not parseable JSON, the connector cannot determine load status and raises DorisStreamLoadError with status 'ParseError', including the first 200 chars of the body.","triggerScenarios":"The stream load HTTP response returns HTML (proxy error page, auth login page), plain text, or a redirect body instead of the expected JSON report; typically due to wrong port, redirect handling, or an intermediary proxy.","commonSituations":"Pointing fe_http_port at the MySQL query port (9030) instead of the HTTP port (8030); a reverse proxy returning HTML error pages; gzip/compressed responses not decompressed.","solutions":["Confirm fe_http_port is the FE HTTP port (default 8030), not the MySQL port (9030)","Check whether a proxy/load balancer sits in front of Doris and bypass it or fix its error responses","Inspect the returned body (shown in the error) to identify the responder and fix routing/auth"],"exampleFix":"// before\nDorisConfig(fe_host=\"fe\", fe_http_port=9030)  # mysql port\n// after\nDorisConfig(fe_host=\"fe\", fe_http_port=8030)  # http port","handlingStrategy":"try-catch","validationCode":"# verify FE HTTP port reachable and returns JSON\nimport urllib.request\nr = urllib.request.urlopen(f\"http://{host}:{port}\")\nassert r.headers.get(\"Content-Type\", \"\").startswith(\"text/json\") or True","typeGuard":null,"tryCatchPattern":"try:\n    await target.sync()\nexcept DorisStreamLoadError as e:\n    if e.status == \"ParseError\":\n        logger.error(\"Non-JSON stream load response: %s\", e)","preventionTips":["Use the FE HTTP port (8030), not the MySQL port (9030)","Bypass or fix proxies that return HTML error pages","Confirm redirect handling (EnableRedirect) matches your cluster setup"],"tags":["doris","stream-load","json","http"],"backgroundTag":"invalid-json-response","analyzedSha":"e84aa99b3292c5270a4b313b2a7137ad9ce8ab3b","analyzedAt":"2026-09-08T15:59:19.997Z","contentChangedAt":"2026-09-08T15:59:19.997Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}