NullPointerException when Trying to Access the User Browser

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

When viewing the "User Browser" in the administration section of JIRA, an error page with the following stack trace appears:

java.lang.RuntimeException: java.lang.NullPointerException
at com.atlassian.jira.web.action.admin.user.UserBrowser.getBrowsableItems(UserBrowser.java:105)
at com.atlassian.jira.web.action.admin.user.UserBrowser.doExecute(UserBrowser.java:55)
at webwork.action.ActionSupport.execute(ActionSupport.java:153)
at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:59)
...
Caused by: java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:896)
at com.opensymphony.user.provider.ofbiz.OFBizAbstractProvider.findUser(OFBizAbstractProvider.java:187)
at com.opensymphony.user.provider.ofbiz.OFBizCredentialsProvider.handles(OFBizCredentialsProvider.java:144)
at com.opensymphony.user.provider.ldap.LDAPCredentialsProvider.handles(LDAPCredentialsProvider.java:269)
at com.opensymphony.user.UserManager.getProvider(UserManager.java:269)
... 105 more

Cause

A null user exists in the userbase table, external_entities table, or the XML backup.

Diagnosis

XML Backup

<OSUser id="10015" passwordHash="..."/>
OR
<OSMembership id="10015" groupName="jira-users"/>

Database

For versions > 4.3

One of the following queries should return the problematic null user entries:

select * from cwd_user where user_name is null;
select * from app_user where lower_user_name is null;
select * from app_user where user_key is null;
select * from cwd_group where lower_group_name is null;
select * from cwd_group where group_name is null;
select * from cwd_membership where membership_type='GROUP_USER' and child_name not in (select user_name from cwd_user);

For versions < 4.3

One of the following queries should return the problematic null user entries:

select * from userbase where username is null
select * from external_entities where NAME is null
select * from groupbase where groupname is null
select * from membershipbase where USER_NAME not in (select username from userbase);

Resolution

The null user offending records must be removed from the database. This includes the record in the userbase or external_entities tables, and any membershipbase records that relate to this user. There are two options:

  1. A SQL-database delete or update command to delete the offending user record.
    OR
  2. A manual update/deleting of the offending user record from the XML backup file followed by a reimporting of the updated XML.


Last modified on Mar 21, 2024

Was this helpful?

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