Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-3842

MethodMissing exceptions from incorrect code or libraries that implement methodMissing metaprogramming can cause rest endpoints page to not load

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 5.6.2.1-jira8
    • Fix Version/s: 5.6.15
    • Component/s: None
    • Labels:
      None
    • Sprint:
      SR4J Sprint 70
    • Critical Points:
      4.7

      Description

      We have identified a problem with our rest endpoints code where the endpoints page will fail to load the endpoints and you will see a red error show on the top right of the screen and this in the logs:

      /rest/scriptrunner/latest/custom/customadmin [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: Ambiguous method overloading for method com.onresolve.scriptrunner.runner.AbstractScriptRunner#convertGroovyClassNameToResourcePath.
          Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
      

      The cause of this error occurs when we cannot resolve a method within the script.
      This error can have several causes:

      1. Customers Script code tries to call a non-existent method
      2. Customers Script includes another groovy feature like the MarkupBuilder which uses missing method exceptions to build the markup. We also use this to make the endpoint and they can clash.
      3. Customers Scripts with an unusual use of Groovy's String interpolation. e.g.
      ${ComponentAccessor.getVersionManager().getVersions(${version} as Long)}
      

      The above is trying to interpolate a string within another string interpolation. The inner most call the ${} is what breaks it.


      Workaround:

      1. Go to the audit log, look for most recent changed rest endpoint. Try to identify the invalid code causing the problem.
      2. Disable and enable scriptrunner which will make the endpoints editable again.
      3. Find the script on the rest endpoint page, edit it and revert the changes.
      4. Save the script and if the code changes corrected the incorrect code the endpoints should be visible again

      If you cannot identify the code causing the problem, please raise a support request and send us the script.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jechlin Jamie Echlin
              Reporter:
              mclark Matthew Clark
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: