{"record":{"id":"d44a3060af588644","repo":"BerriAI/litellm","slug":"failed-to-check-access-group-existence-e","errorCode":null,"errorMessage":"Failed to check access group existence: {e}","messagePattern":"Failed to check access group existence: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/management_endpoints/model_access_group_management_endpoints.py","lineNumber":649,"sourceCode":"        raise HTTPException(\n            status_code=400,\n            detail={\"error\": \"Either model_names or model_ids must be provided and non-empty\"},\n        )\n\n    use_model_ids: Final = has_model_ids\n\n    # Validation: Check if access group exists\n    try:\n        access_groups_map: Final = await get_all_access_groups_from_db(prisma_client=prisma_client)\n        if access_group not in access_groups_map:\n            raise HTTPException(\n                status_code=404,\n                detail={\"error\": f\"Access group '{access_group}' not found\"},\n            )\n    except HTTPException:\n        raise\n    except Exception as e:\n        raise HTTPException(\n            status_code=500,\n            detail={\"error\": f\"Failed to check access group existence: {e}\"},\n        )\n\n    # Validation: Check if all new models exist (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","sourceCodeStart":631,"sourceCodeEnd":667,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/model_access_group_management_endpoints.py#L631-L667","documentation":"Catch-all around the existence pre-check in the access-group update flow: the DB query for existing groups failed with an unexpected error, so the update cannot safely proceed; logged and converted to this 500. The 404 for a genuinely absent group is raised separately.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/model_access_group_management_endpoints.py:649 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check proxy server logs for the underlying exception details.","Verify database connectivity."],"exampleFix":null,"handlingStrategy":"try-catch","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"}