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

Integrity Checker Should Check and Fix Invalid Scheme References to Removed Projects

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      NOTE: This suggestion is for JIRA Cloud. Using JIRA Server? See the corresponding suggestion.

      From time to time, JIRA's nodeassociation table has abandoned references between schemes and projects. This is suspected to occur if a project was deleted, but for some reason these references remain.

      The integrity checker should help detect when a non-valid project ID is referenced in nodeassociation and remove the reference.

      As of JIRA 7.x, for example, if there is a reference to a non-existent project, the UI will result in an error and prevent admins from modifying the schemes. The logs show:

      2017-03-10 14:51:25,249 http-nio-8080-exec-46 uri:/jira/secure/admin/views/permissions/viewschemes.jsp username: admin ERROR admin 891x118804x1 1ya7wma 10.102.167.67,0:0:0:0:0:0:0:1 /secure/admin/ViewPermissionSchemes.jspa [webwork.util.ValueStack] METHOD: "projects", exception: 
      java.lang.NullPointerException
      	at java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:469)
      	at java.util.TimSort.binarySort(TimSort.java:296)
      	at java.util.TimSort.sort(TimSort.java:239)
      	at java.util.Arrays.sort(Arrays.java:1512)
      	at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:348)
      	at java.util.stream.Sink$ChainedReference.end(Sink.java:258)
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
      	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
      	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
      	at com.atlassian.jira.scheme.AbstractSchemeManager.getProjects(AbstractSchemeManager.java:481)
      	at com.atlassian.jira.scheme.AbstractViewSchemes.getProjects(AbstractViewSchemes.java:13)
      	... 2 filtered
      	...
      

      A method to look for these bad references is via SQL:

      • For example, when looking for a permission scheme that refers to be non-existent project:
        select * from nodeassociation where sink_node_entity = 'PermissionScheme' and sink_node_id = 0 and source_node_id not in (select id from project);
        
      • This will return references that have an invalid project ID
      • This row should then be removed

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dchan David Chan
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: