Count of active users is greater than the total number of users

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

JIRA shows a count of active users that is greater than the total number of users in the instance.

There are currently 8 total user(s) set up in JIRA, of which 17 are active and count towards your license limit.

Cause

The root cause for this issue is still under investigation. Early investigation on the below bug report suggests that users can still be present on cwd_membership or membershipbase tables even after they have been deleted from JIRA.

JRA-19805 - Getting issue details... STATUS

As JIRA counts the number of active users based on all users granted the USE permission, an entry on the cwd_membership or membershipbase of an user that does not exist anymore on the cwd_user or userbase but has been granted the USE permission in the past will be considered an active user.

Diagnosis

In order to check if your instance is affected by this bug, run the below query.

JIRA 4.2.x and earlier

In JIRA 4.2.x and earlier, memberships were stored on the membershipbase table, so use the below query to remove deprecated entries there.

SELECT user_name FROM membershipbase WHERE user_name NOT IN (SELECT username FROM userbase); 
JIRA 4.3 and later

On versions later than 4.3, the memberships are stored on the cwd_membership table, so use the below query to remove deprecated entries there.

SELECT FROM cwd_membership WHERE child_id NOT IN (SELECT id FROM cwd_user);

Workaround

Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.

For now, the way to workaround this problem is to delete entries of non-existing users from the membership tables.

JIRA 4.2.x and earlier

In JIRA 4.2.x and earlier, memberships were stored on the membershipbase table, so use the below query to remove deprecated entries there.

DELETE FROM membershipbase WHERE user_name NOT IN (SELECT username FROM userbase);
JIRA 4.3 and later

On versions later than 4.3, the memberships are stored on the cwd_membership table, so use the below query to remove deprecated entries there.

DELETE FROM cwd_membership WHERE child_id NOT IN (SELECT id FROM cwd_user);
Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.