NullPointerException when editing members of a Project Role
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs 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
Summary
Symptoms
Trying to edit members of a Project Role fails with an error similar to the following on the UI
1
2
3
4
An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug.
Details: -------
org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getUserPickerHtml' in class com.atlassian.jira.web.action.admin.roles.UserRoleActorAction threw exception java.lang.NullPointerException at com.atlassian.jira.plugin.system.projectroleactors:atlassian-user-role-actor-action//templates/plugins/jira/projectroles/user-role-actor.vm
Similar stacktrace appears in the atlassian-jira.log
:
1
2
3
4
5
2013-10-21 10:42:49,123 http-8090-3 ERROR xxxx 38569x43478x1 14ywz09 /secure/project/UserRoleActorAction.jspa [com.atlassian.velocity.DefaultVelocityManager] MethodInvocationException occurred getting message body from Velocity: java.lang.NullPointerException
java.lang.NullPointerException
at com.opensymphony.user.User.getFullName(User.java:86)
at com.atlassian.jira.security.roles.actor.UserRoleActorFactory$UserRoleActor.getDescriptor(UserRoleActorFactory.java:123)
at com.atlassian.jira.security.roles.RoleActorComparator.compare(RoleActorComparator.java:37)
Diagnosis
Run the following SQL query against the JIRA database, if any results are returned then this KB is applicable:
1
select roletypeparameter from projectroleactor where roletype = 'atlassian-user-role-actor' and roletypeparameter not in (select user_key from app_user);
Cause
A non-existent JIRA user is being referenced from the projectroleactor table of JIRA database (ℹ️ The projectroleactor table stores the members of project roles in JIRA projects). This user may have previously existed, but may have been removed (probably via LDAP). Note that the previous query may not find users who have been removed from the system by removing the directory they were associated with. In this case the error will still occur and you will need to identify which users are associated with a project role and associated to a directory that no longer exists in the system.
Solution
Workaround
Run the following SQL query to retrieve non-existent JIRA users who are still being refererred to in a Project Role.
1
select roletypeparameter from projectroleactor where roletype = 'atlassian-user-role-actor' and roletypeparameter not in (select user_key from app_user);
Re-create the usernames returned from the query above in JIRA.
Remove this users from the Project Roles before deleting them from JIRA Again.
Resolution
The issue is being tracked in JRASERVER-22622 - Better handling on corrupted project role
Was this helpful?