Details
-
Bug
-
Resolution: Fixed
-
Low
Description
NOTE: This bug report is for JIRA Cloud. Using JIRA Server? See the corresponding bug report.
Summary
The default permission scheme cannot be edited. Editing causes a blank page with NPE.
Steps to Reproduce
- Configure the permission scheme to include a single user.
- Remove the user from user management
- Load Permission Scheme
- Edit the system Default Permission Scheme
Expected Results
Default Permission Scheme is loaded
Actual Results
A blank Page is shown
JIRA logs displays below error
2016-02-12 09:05:51.018914500 2016-02-12 09:05:51,015 http-nio-2990-exec-3 ERROR sysadmin 545x434x1 13irxx6 103.233.242.8,104.192.140.49,127.0.0.1 /rest/internal/2/managedpermissionscheme/11900 [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: null 2016-02-12 09:05:51.018916500 java.lang.NullPointerException 2016-02-12 09:05:51.018916500 at com.atlassian.jira.permission.DefaultPermissionSchemeService.updateSchemeToReturnUsername(DefaultPermissionSchemeService.java:436) 2016-02-12 09:05:51.018917500 at com.atlassian.jira.permission.DefaultPermissionSchemeService.access$2200(DefaultPermissionSchemeService.java:58) 2016-02-12 09:05:51.018951500 at com.atlassian.jira.permission.DefaultPermissionSchemeService$13.apply(DefaultPermissionSchemeService.java:331) 2016-02-12 09:05:51.018951500 at com.atlassian.jira.permission.DefaultPermissionSchemeService$13.apply(DefaultPermissionSchemeService.java:327) 2016-02-12 09:05:51.018952500 at com.atlassian.fugue.Option$Some.fold(Option.java:421) 2016-02-12 09:05:51.018952500 at com.atlassian.fugue.Option.flatMap(Option.java:287) 2016-02-12 09:05:51.018956500 at com.atlassian.jira.permission.DefaultPermissionSchemeService.getScheme(DefaultPermissionSchemeService.java:327) 2016-02-12 09:05:51.018957500 at com.atlassian.jira.permission.DefaultPermissionSchemeService.getPermissionScheme(DefaultPermissionSchemeService.java:105) 2016-02-12 09:05:51.018962500 at com.atlassian.jira.permission.management.ManagedPermissionSchemeHelperImpl.getManagedPermissionScheme(ManagedPermissionSchemeHelperImpl.java:92) 2016-02-12 09:05:51.018962500 ... 3 filtered
Notes
- Cloning the default permission scheme causes the same problem.
- Using the delete user API will delete these records.
- It appears that this can be caused by deleting users from a user directory (by removing that directory), or through other means.
Workaround
For Cloud, please contact Support. For server:
Can fix this with:
- Execute the below SQL to identify problematic records:
select * from schemepermissions where perm_type = 'user' and (perm_parameter in (select user_key from app_user where lower_user_name not in (select lower_user_name from cwd_user)) or perm_parameter not in (select user_key from app_user));
- Stop JIRA.
- Backup the JIRA database using the native DB tools.
- Remove the problematic records.
- Start JIRA.
- Test by editing the scheme.
If there's any issues with the update, roll-back to the backup. For additional help please raise a support case at support.atlassian.com.
Attachments
Issue Links
- is duplicated by
-
JRACLOUD-60080 Permission Scheme 500 Error and Nullpointerexception
- Closed
- is related to
-
JRASERVER-59781 Permission Scheme cannot be edited when it includes a single user
- Closed
- relates to
-
JRACLOUD-59683 Permission schemes with non-existent users that have been explicitly granted a permission cannot be edited
- Closed