BerriAI/litellm · error · ProxyException

Uploading with target_model_names requires a database-connec

Error message

Uploading with target_model_names requires a database-connected proxy, and this proxy has no database configured

What it means

ProxyException raised when uploading with target_model_names (managed files with load-balancing) on a proxy started without a database: managed files require persisting file records, and no DB is configured, so the managed upload path cannot operate.

Source

Thrown at litellm/proxy/openai_files_endpoints/storage_backend_service.py:74

        Raises:
            ProxyException: If storage backend is invalid or upload fails
        """
        # Get storage backend instance
        try:
            storage_backend: Final = get_storage_backend(target_storage)
        except ValueError as e:
            raise ProxyException(
                message=str(e),
                type="invalid_request_error",
                param="target_storage",
                code=400,
            )

        if target_model_names:
            managed_files_hook: Final = proxy_logging_obj.get_proxy_hook("managed_files")
            if not isinstance(managed_files_hook, BaseFileEndpoints):
                raise ProxyException(
                    message="Uploading with target_model_names requires a database-connected proxy, and this proxy has no database configured",
                    type="invalid_request_error",
                    param="target_model_names",
                    code=400,
                )

        # Extract file information
        file_content: Final = file_data["content"]
        filename: Final = file_data.get("filename", "file")
        content_type: Final = file_data.get("content_type", "application/octet-stream")

        # Upload to storage backend
        storage_url: Final = await storage_backend.upload_file(
            file_content=file_content,
            filename=filename,
            content_type=content_type,
            path_prefix="",
            file_naming_strategy="uuid",

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Set DATABASE_URL to connect a database, or upload without target_model_names.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/openai_files_endpoints/storage_backend_service.py:74 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/5d825ea328e2fe2d. Report an issue: GitHub.