{"record":{"id":"e2b97d384654aaf7","repo":"BerriAI/litellm","slug":"index-index-create-request-index-name-already-ex","errorCode":null,"errorMessage":"Index {index_create_request.index_name} already exists","messagePattern":"Index (.+?) already exists","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/vector_store_endpoints/endpoints.py","lineNumber":585,"sourceCode":"    assert_proxy_admin_for_vector_store_index_management(\n        user_api_key_dict,\n        operation=\"create\",\n    )\n\n    if prisma_client is None:\n        raise HTTPException(\n            status_code=500,\n            detail=CommonProxyErrors.db_not_connected_error.value,\n        )\n    ## 1. check if index already exists\n    existing_index: Final = await ManagedVectorStoreIndexRepository(prisma_client).table.find_unique(\n        where={\"index_name\": index_create_request.index_name}\n    )\n\n    ## 2. set created_by and updated_by\n\n    if existing_index is not None:\n        raise HTTPException(\n            status_code=400,\n            detail=f\"Index {index_create_request.index_name} already exists\",\n        )\n\n    ## 2. create index\n    index_data: Final = index_create_request.model_dump(exclude_none=True)\n    index_data[\"created_by\"] = user_api_key_dict.user_id\n    index_data[\"updated_by\"] = user_api_key_dict.user_id\n    new_index = await ManagedVectorStoreIndexRepository(prisma_client).table.create(data=jsonify_object(index_data))\n\n    return new_index.model_dump()\n\n\n@router.get(\n    \"/v1/indexes\",\n    dependencies=[Depends(user_api_key_auth)],\n    response_model=IndexListResponse,\n)","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/vector_store_endpoints/endpoints.py#L567-L603","documentation":"Uniqueness guard on vector-store index creation: a LiteLLM_ManagedVectorStoreIndex row with the same index_name already exists (checked via find_unique before insert). Index names are globally unique; use a different name or update/delete the existing index.","triggerScenarios":"Thrown at litellm/proxy/vector_store_endpoints/endpoints.py:585 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a different index_name or delete/reuse the existing index."],"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"}