Unable to add a new group due to error A group or user with this name already exists
Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.
When attempting to add a new group to Jira, the administrator is presented with the error, "A group or user with this name already exists."
However, when attempting to filter for existing groups with the same name, no such group with that name is displayed.
The following image demonstrates how this would appear to the administrator.
You are affected if the following conditions are met:
Attempting to filter by the specific group does not display any matches in the list of groups.
Querying for the specific group against the database does not return any matches.
select * from cwd_group where lower_group_name like '%examplegroup%';
This issue occurs when there is an integrity issue between Jira's caches and the database. Adding a group first checks Jira's caches in order to validate whether the group already exists in them, whereas the list of groups displayed are pulled from the database directly. If the caches contain the group, but the database does not, this leads to this inconsistency.
This issue can be triggered when a group is removed from the database but not from the caches- it is possible that automation, customizations, and/or 3rd party functionalities may cause this due to bugs in their implementation.
No known workaround at this time.
Resolving this requires these caches to be rebuilt. Jira will need to be restarted, which will drop these caches and recreate them from the database upon the next startup. If this is a data center instance then a rolling restart may not be sufficient and a hard stop and start of JIRA on all nodes will be necessary.