Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JRACLOUD-59781

Permission Scheme cannot be edited when it includes a single user

    XMLWordPrintable

Details

    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

      1. Configure the permission scheme to include a single user.
      2. Remove the user from user management
      3. Load Permission Scheme
      4. 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:

      1. 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));
        
      2. Stop JIRA.
      3. Backup the JIRA database using the native DB tools.
      4. Remove the problematic records.
      5. Start JIRA.
      6. 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

          Activity

            People

              Unassigned Unassigned
              nmohdkhalid Nabil
              Votes:
              3 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: