{"record":{"id":"2ed2be3b123c9515","repo":"BerriAI/litellm","slug":"database-not-connected-cannot-create-access-group","errorCode":null,"errorMessage":"Database not connected. Cannot create access group.","messagePattern":"Database not connected\\. Cannot create access group\\.","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/management_endpoints/model_access_group_management_endpoints.py","lineNumber":406,"sourceCode":"    use_model_ids: Final = has_model_ids\n\n    # Validate model_names exist in router (only if using model_names path)\n    if not use_model_ids and has_model_names:\n        assert data.model_names is not None\n        all_valid, missing_models = validate_models_exist(\n            model_names=data.model_names,\n            llm_router=llm_router,\n        )\n\n        if not all_valid:\n            raise HTTPException(\n                status_code=400,\n                detail={\"error\": f\"Model(s) not found: {', '.join(missing_models)}\"},\n            )\n\n    # Check if database is connected\n    if prisma_client is None:\n        raise HTTPException(\n            status_code=500,\n            detail={\"error\": \"Database not connected. Cannot create access group.\"},\n        )\n\n    try:\n        # Check if access group already exists\n        existing_access_groups: Final = await get_all_access_groups_from_db(prisma_client=prisma_client)\n\n        if data.access_group in existing_access_groups:\n            raise HTTPException(\n                status_code=409,\n                detail={\n                    \"error\": f\"Access group '{data.access_group}' already exists. Use PUT /access_group/{data.access_group}/update to modify it.\"\n                },\n            )\n\n        # Update deployments using the appropriate method\n        if use_model_ids:","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/model_access_group_management_endpoints.py#L388-L424","documentation":"Infrastructure guard on access-group creation: prisma_client is None because the proxy runs without a database, but access groups are stored exclusively in the DB. Request rejected with 500 before any write.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/model_access_group_management_endpoints.py:406 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set DATABASE_URL to a PostgreSQL connection string and restart the proxy."],"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"}