{"record":{"id":"5d825ea328e2fe2d","repo":"BerriAI/litellm","slug":"uploading-with-target-model-names-requires-a-datab","errorCode":null,"errorMessage":"Uploading with target_model_names requires a database-connected proxy, and this proxy has no database configured","messagePattern":"Uploading with target_model_names requires a database-connected proxy, and this proxy has no database configured","errorType":"http","errorClass":"ProxyException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/openai_files_endpoints/storage_backend_service.py","lineNumber":74,"sourceCode":"\n        Raises:\n            ProxyException: If storage backend is invalid or upload fails\n        \"\"\"\n        # Get storage backend instance\n        try:\n            storage_backend: Final = get_storage_backend(target_storage)\n        except ValueError as e:\n            raise ProxyException(\n                message=str(e),\n                type=\"invalid_request_error\",\n                param=\"target_storage\",\n                code=400,\n            )\n\n        if target_model_names:\n            managed_files_hook: Final = proxy_logging_obj.get_proxy_hook(\"managed_files\")\n            if not isinstance(managed_files_hook, BaseFileEndpoints):\n                raise ProxyException(\n                    message=\"Uploading with target_model_names requires a database-connected proxy, and this proxy has no database configured\",\n                    type=\"invalid_request_error\",\n                    param=\"target_model_names\",\n                    code=400,\n                )\n\n        # Extract file information\n        file_content: Final = file_data[\"content\"]\n        filename: Final = file_data.get(\"filename\", \"file\")\n        content_type: Final = file_data.get(\"content_type\", \"application/octet-stream\")\n\n        # Upload to storage backend\n        storage_url: Final = await storage_backend.upload_file(\n            file_content=file_content,\n            filename=filename,\n            content_type=content_type,\n            path_prefix=\"\",\n            file_naming_strategy=\"uuid\",","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/openai_files_endpoints/storage_backend_service.py#L56-L92","documentation":"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.","triggerScenarios":"Thrown at litellm/proxy/openai_files_endpoints/storage_backend_service.py:74 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set DATABASE_URL to connect a database, or upload without target_model_names."],"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-14T05:17:10.506Z"}