Details
-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
4.0.1, 5.2.5
-
4
-
1
-
Severity 3 - Minor
-
Description
Symptoms
Stack trace (from 500 page):
2010-02-03 17:12:19,980 http-8080-Processor23 [webwork.dispatcher.ServletDispatcher] Could not execute action
java.lang.NullPointerException
at com.atlassian.jira.scheme.mapper.SchemeTransformResult.addRoleMappingForGroup(SchemeTransformResult.java:126)
at com.atlassian.jira.scheme.mapper.SchemeGroupsToRolesTransformerImpl.transformScheme(SchemeGroupsToRolesTransformerImpl.java:172)
at com.atlassian.jira.scheme.mapper.SchemeGroupsToRolesTransformerImpl.doTransform(SchemeGroupsToRolesTransformerImpl.java:48)
at com.atlassian.jira.bc.scheme.mapper.DefaultSchemeGroupsToRoleTransformerService.doTransform(DefaultSchemeGroupsToRoleTransformerService.java:41)
at com.atlassian.jira.web.action.admin.scheme.mapper.SchemeGroupToRoleTransformerAction.doDefault(SchemeGroupToRoleTransformerAction.java:50)
Steps to reproduce
- Create a group testgroup
- Add group to an event in Default Notification Scheme
- Delete group testgroup
- Go to Administration > Scheme Tools > Group to Project Role Mapping Tool
- From the dropdown select notification scheme and then from the list select Default Notification Scheme and then click Map Groups to Roles
- Next to the group testgroup select the dropdown Users and click Preview Mappings
- 500 page with exception is shown
I guess this is a bug in two ways:
- NullPointerException shouldn't be thrown. There should be some way of mapping out the non-existent group to a project role.
- But more importantly, when you delete a group, it should delete associated scheme entities
We should at least have a check for this in the Integrity Checker?
Workaround
As a workaround for this bug, we can remove the groups that no longer exists from the Notification schemes and Permission Schemes.
We can find what schemes have non-existant groups by running the following queries on your database
Notification Schemes:
select NS.name,N.notif_parameter from notification N join notificationscheme NS on N.scheme=NS.id where N.notif_type = 'Group_Dropdown' and N.notif_parameter not in (select group_name from cwd_group) group by NS.name,N.notif_parameter
Permission Schemes:
select PS.name,P.perm_parameter from schemepermissions P join permissionscheme PS on P.scheme=PS.id where P.perm_type = 'group' and P.perm_parameter not in (select group_name from cwd_group) group by PS.name,P.perm_parameter
Navigate on JIRA to the Notification/Permission scheme returned by the query and remove the groups specified by the queries.