BerriAI/litellm · error · HTTPException

Must provide file, file_url, or file_id

Error message

Must provide file, file_url, or file_id

What it means

RAG ingest request validation: after parsing the JSON body, none of the three accepted file sources is present — no inline 'file' object, no 'file_url', and no 'file_id' — so there is nothing to ingest; rejected with 400.

Source

Thrown at litellm/proxy/rag_endpoints/endpoints.py:355

        file_obj = data.get("file")
        if file_obj and isinstance(file_obj, dict):
            filename: Final = file_obj.get("filename")
            content_b64: Final = file_obj.get("content")
            content_type = file_obj.get("content_type", "application/octet-stream")

            if filename and content_b64:
                try:
                    file_content = base64.b64decode(content_b64)
                    file_data = (filename, file_content, content_type)
                except Exception as e:
                    raise HTTPException(
                        status_code=400,
                        detail={"error": f"Invalid base64 content: {e}"},
                    )

    # Validate
    if file_data is None and file_url is None and file_id is None:
        raise HTTPException(
            status_code=400,
            detail={"error": "Must provide file, file_url, or file_id"},
        )

    if "vector_store" not in ingest_options:
        raise HTTPException(
            status_code=400,
            detail={"error": "ingest_options must contain 'vector_store' configuration"},
        )

    # Credential fields must come from server configuration, not user requests.
    # Accepting user-supplied credentials (e.g. vertex_credentials with
    # type=external_account + credential_source.file=/proc/1/environ) allows
    # any authenticated user to exfiltrate host secrets via SSRF through
    # google-auth's identity_pool credential refresh.
    # api_base is also blocked: a user-controlled base URL causes the server
    # to send its configured provider credentials to an attacker endpoint.
    _BLOCKED_VECTOR_STORE_CREDENTIAL_PARAMS: Final = {

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Provide exactly one of file (base64), file_url, or file_id in the ingest request.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/rag_endpoints/endpoints.py:355 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/8d6279a20cb81fd5. Report an issue: GitHub.