Unable to Create New User Due to InsufficientPrivilegeException
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
Not able to create new user. The following appears in the stacktrace
:
com.atlassian.confluence.core.InsufficientPrivilegeException: User [user.name] does not have the required privileges.
at com.atlassian.confluence.user.DefaultUserAccessor.addMembership(DefaultUserAccessor.java:118)
Cause
There are 2 known causes for this issue.
CAUSE 1
confluence-users
is a default group that every new user created will be added to. Somehow confluence-users
does not exist, hence the error is thrown.
This error is misleading, and we are investigating that issue here: CONF-22778 - Getting issue details... STATUS
CAUSE 2
In case the instance was migrated from Cloud, the default group is not Confluence-users, so even adding the Confluence-users group, the issue might persist.
In this case we must locate the default group in the database and change it to be Confluence-users.
Resolution
CAUSE 1
Create the confluence-users
group manually through the UI (Confluence Admin >> Manage Groups).
CAUSE 2
ALWAYS PERFORM A FULL BACKUP OF THE DATABASE BEFORE MAKING ANY CHANGE TO IT.
1) Identify the current default group of Confluence:
select bandanavalue from bandana where bandanakey='atlassian.confluence.settings';
2) Locate the <defaultUsersGroup> tag and check which is the default group for Confluence.
3) Copy the entire result of the query above and replace the default users group value inside the tag with the "confluence-users" value
4) Run a update query with the entire result from above plus the modified group. (Note that if you do this update incorrectly and remove information from the results, Confluence will crash. Make sure to have a backup of Confluence)
5) Restart Confluence and you should now be able to create new users in the default group "confluence-users"