{"record":{"id":"9a090dfc02d91452","repo":"BerriAI/litellm","slug":"access-group-is-required-and-cannot-be-empty","errorCode":null,"errorMessage":"access_group is required and cannot be empty","messagePattern":"access_group is required and cannot be empty","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/model_access_group_management_endpoints.py","lineNumber":372,"sourceCode":"    - model_names: List[str] - List of existing model groups to include\n    \n    Returns:\n    - NewModelGroupResponse with the created access group details\n    \n    Raises:\n    - HTTPException 400: If any model names don't exist\n    - HTTPException 500: If database operations fail\n    \"\"\"\n    from litellm.proxy.proxy_server import (\n        llm_router,\n        prisma_client,\n    )\n\n    verbose_proxy_logger.debug(\"Creating access group: %s with models: %s\", data.access_group, data.model_names)\n\n    # Validation: Check if access_group is provided\n    if not data.access_group or not data.access_group.strip():\n        raise HTTPException(\n            status_code=400,\n            detail={\"error\": \"access_group is required and cannot be empty\"},\n        )\n\n    # Validation: Check that at least one of model_names or model_ids is provided\n    has_model_names: Final = data.model_names and len(data.model_names) > 0\n    has_model_ids: Final = data.model_ids and len(data.model_ids) > 0\n\n    if not has_model_names and not has_model_ids:\n        raise HTTPException(\n            status_code=400,\n            detail={\"error\": \"Either model_names or model_ids must be provided and non-empty\"},\n        )\n\n    # If model_ids is provided, use it (more precise targeting)\n    use_model_ids: Final = has_model_ids\n\n    # Validate model_names exist in router (only if using model_names path)","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/model_access_group_management_endpoints.py#L354-L390","documentation":"Validation in access-group creation: data.access_group is empty/missing after truthiness checks, so the group cannot be named or registered.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/model_access_group_management_endpoints.py:372 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty access_group value in the request body."],"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"}