{"record":{"id":"b70c035ef25126a4","repo":"BerriAI/litellm","slug":"invalid-base64-content-e","errorCode":null,"errorMessage":"Invalid base64 content: {e}","messagePattern":"Invalid base64 content: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/rag_endpoints/endpoints.py","lineNumber":348,"sourceCode":"        # JSON body\n        data: Final = await _read_request_body(request)\n        ingest_options = data.get(\"ingest_options\", {})\n        file_url = data.get(\"file_url\")\n        file_id = data.get(\"file_id\")\n\n        # Handle base64-encoded file in JSON body\n        file_obj = data.get(\"file\")\n        if file_obj and isinstance(file_obj, dict):\n            filename: Final = file_obj.get(\"filename\")\n            content_b64: Final = file_obj.get(\"content\")\n            content_type = file_obj.get(\"content_type\", \"application/octet-stream\")\n\n            if filename and content_b64:\n                try:\n                    file_content = base64.b64decode(content_b64)\n                    file_data = (filename, file_content, content_type)\n                except Exception as e:\n                    raise HTTPException(\n                        status_code=400,\n                        detail={\"error\": f\"Invalid base64 content: {e}\"},\n                    )\n\n    # Validate\n    if file_data is None and file_url is None and file_id is None:\n        raise HTTPException(\n            status_code=400,\n            detail={\"error\": \"Must provide file, file_url, or file_id\"},\n        )\n\n    if \"vector_store\" not in ingest_options:\n        raise HTTPException(\n            status_code=400,\n            detail={\"error\": \"ingest_options must contain 'vector_store' configuration\"},\n        )\n\n    # Credential fields must come from server configuration, not user requests.","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/rag_endpoints/endpoints.py#L330-L366","documentation":"JSON-body ingestion guard: the request supplied a file object with filename and content, but the 'content' field failed base64 decoding (malformed base64 string), so the file bytes cannot be reconstructed; rejected with 400 including the decoder's error text.","triggerScenarios":"Thrown at litellm/proxy/rag_endpoints/endpoints.py:348 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send valid base64-encoded file content; re-encode the file with standard base64 and retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}