{"record":{"id":"11e81fdaba103e76","repo":"BerriAI/litellm","slug":"access-group-update-data-get-access-group-name","errorCode":null,"errorMessage":"Access group '{update_data.get('access_group_name', '')}' already exists","messagePattern":"Access group '(.+?)' already exists","errorType":"http","errorClass":"HTTPException","httpStatus":409,"severity":"error","filePath":"litellm/proxy/management_endpoints/access_group_endpoints.py","lineNumber":495,"sourceCode":"            teams_to_remove = list(old_team_ids - new_team_ids)\n            keys_to_add = list(new_key_ids - old_key_ids)\n            keys_to_remove = list(old_key_ids - new_key_ids)\n\n            record: Final = await tx.litellm_accessgrouptable.update(\n                where={\"access_group_id\": access_group_id},\n                data=update_data,\n            )\n\n            await _sync_add_access_group_to_teams(tx, teams_to_add, access_group_id)\n            await _sync_remove_access_group_from_teams(tx, teams_to_remove, access_group_id)\n            await _sync_add_access_group_to_keys(tx, keys_to_add, access_group_id)\n            await _sync_remove_access_group_from_keys(tx, keys_to_remove, access_group_id)\n    except HTTPException:\n        raise\n    except Exception as e:\n        # Unique constraint violation (e.g. access_group_name already exists).\n        if \"unique constraint\" in str(e).lower() or \"P2002\" in str(e):\n            raise HTTPException(\n                status_code=status.HTTP_409_CONFLICT,\n                detail=f\"Access group '{update_data.get('access_group_name', '')}' already exists\",\n            )\n        raise\n\n    from litellm.proxy.proxy_server import proxy_logging_obj, user_api_key_cache\n\n    await _cache_access_group_record(record)\n    await _patch_team_caches_add_access_group(teams_to_add, access_group_id, user_api_key_cache, proxy_logging_obj)\n    await _patch_team_caches_remove_access_group(\n        teams_to_remove, access_group_id, user_api_key_cache, proxy_logging_obj\n    )\n    await _patch_key_caches_add_access_group(keys_to_add, access_group_id, user_api_key_cache, proxy_logging_obj)\n    await _patch_key_caches_remove_access_group(keys_to_remove, access_group_id, user_api_key_cache, proxy_logging_obj)\n\n    return _record_to_response(record)\n\n","sourceCodeStart":477,"sourceCodeEnd":513,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/access_group_endpoints.py#L477-L513","documentation":"Error \"Access group '{update_data.get('access_group_name', '')}' already exists\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/access_group_endpoints.py:495 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a different access_group_name for the update.","Leave the name unchanged if renaming is not needed."],"exampleFix":null,"handlingStrategy":null,"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-14T00:17:10.932Z"}