{"record":{"id":"cde3a6f77aa7e4a2","repo":"cocoindex-io/cocoindex","slug":"authentication-failed-http-status-code","errorCode":null,"errorMessage":"Authentication failed: HTTP {status_code}","messagePattern":"Authentication failed: HTTP (.+?)","errorType":"exception","errorClass":"DorisAuthError","httpStatus":null,"severity":"critical","filePath":"python/cocoindex/connectors/doris/_target.py","lineNumber":640,"sourceCode":"            if status_code == 307 and location:\n                from urllib.parse import urlparse, urlunparse\n\n                parsed = urlparse(location)\n                rewritten = urlunparse(\n                    parsed._replace(\n                        netloc=f\"{config.be_load_host}:{parsed.port or config.fe_http_port}\"\n                    )\n                )\n                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\"),","sourceCodeStart":622,"sourceCodeEnd":658,"githubUrl":"https://github.com/cocoindex-io/cocoindex/blob/e84aa99b3292c5270a4b313b2a7137ad9ce8ab3b/python/cocoindex/connectors/doris/_target.py#L622-L658","documentation":"The Doris stream load HTTP endpoint returned 401/403, meaning the FE rejected the request's credentials (basic auth user/password or token). The connector raises DorisAuthError with host/port context so you know which node rejected you.","triggerScenarios":"Calling the stream-load path (appending rows/target sync) with wrong fe username/password in the Doris config, a user lacking LOAD/INSERT privilege on the target table, or revoked/expired credentials.","commonSituations":"Misconfigured password after rotation; using a read-only account for stream load; pointing at a FE that requires different auth; LDAP-enabled cluster with wrong auth scheme.","solutions":["Verify username/password in the Doris target config and test with curl -u against the FE stream load URL","Grant the user LOAD/INSERT privileges on the target database/table (GRANT LOAD_PRIV)","Check for recent credential rotation and update the stored config"],"exampleFix":"// before\nconfig = DorisConfig(fe_host=\"fe\", fe_http_port=8030, username=\"reader\", password=\"...\")\n// after\nconfig = DorisConfig(fe_host=\"fe\", fe_http_port=8030, username=\"admin\", password=\"<correct>\")","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await app.update()\nexcept DorisAuthError as e:\n    logger.error(\"Doris auth failed at %s:%s — check credentials/privileges\", e.host, e.port)","preventionTips":["Verify credentials with curl -u user:pass against the FE stream load endpoint before deploying","Grant the load user LOAD/INSERT privileges","Rotate secrets centrally so config stays in sync"],"tags":["doris","authentication","http","stream-load"],"backgroundTag":"authentication-required","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"}