Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-20643

JMXInstrumentsLoggingService RUNNING WARN - RequestCache being used in an invalid context

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Low Low (View bug fix roadmap)
    • None
    • 8.11.0
    • REST API
    • None

      Issue Summary

      There are warnings being triggered on the latest Jira software version due to the `RequestCacheImpl` being used outside of a request thread by the `JMXInstrumentsLoggingService`. This will not work in the future, so we need to fix it.

      Steps to Reproduce

      1. Install Jira Software v8.11

      The below exception is thrown in the Atlassian-jira.log file:

      2020-07-17 13:50:05,242+0530 JMXInstrumentsLoggingService STARTING INFO      [atlassian-performance] Scheduling JMXINSTRUMENTS with poll interval of 60 seconds 2020-07-17 13:50:05,243+0530 JMXInstrumentsLoggingService STARTING 
      
      INFO      [atlassian-performance] all services started and healthy 2020-07-17 13:50:05,243+0530 JMXInstrumentsLoggingService RUNNING WARN      [c.a.j.cache.request.RequestCacheImpl] Incorrect usage of JIRA API. You can only create/use: RequestCacheImpl inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtil for details. 2020-07-17 13:50:05,243+0530 JMXInstrumentsLoggingService RUNNING WARN      [c.a.j.cache.request.RequestCacheImpl] From Jira 9.0 version creation/usage of RequestCacheImpl will throw the IllegalStateException. 2020-07-17 
      
      13:50:05,244+0530 JMXInstrumentsLoggingService RUNNING WARN      [c.a.j.cache.request.RequestCacheImpl] Incorrect usage of JIRA API. You can only create/use: RequestCacheImpl inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtil for details. 2020-07-17 13:50:05,244+0530 JMXInstrumentsLoggingService RUNNING WARN      [c.a.j.cache.request.RequestCacheImpl] From Jira 9.0 version creation/usage of RequestCacheImpl will throw the IllegalStateException. 2020-07-17 13:51:05,247+0530 JMXInstrumentsLoggingService RUNNING WARN      [c.a.j.cache.request.RequestCacheImpl] Incorrect usage of JIRA API. You can only create/use: RequestCacheImpl inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtil for details.
      

      Workaround

      Tried workaround JSDSERVER-6897

      set the package to ERROR (this setting will remain after a Jira restart)

      • Edit the file <JIRA_INSTALLATION>/atlassian-jira/WEB-INF/classes/log4j.properties
      • Add the 2 following lines at the end of the file and save it:
        log4j.logger.com.atlassian.jira.cache.request.RequestCacheImpl = ERROR, filelog
        log4j.additivity.com.atlassian.jira.cache.request.RequestCacheImpl = false
        
      • Restart the Jira application

            [JSWSERVER-20643] JMXInstrumentsLoggingService RUNNING WARN - RequestCache being used in an invalid context

            Andriy Yakovlev [Atlassian] made changes -
            Resolution New: Duplicate [ 3 ]
            Status Original: Needs Triage [ 10030 ] New: Closed [ 6 ]
            Andriy Yakovlev [Atlassian] made changes -
            Link New: This issue duplicates JRASERVER-71310 [ JRASERVER-71310 ]
            Bugfix Automation Bot made changes -
            Introduced in Version New: 8.11
            Danish (Inactive) made changes -
            Description Original: h3. Issue Summary

            There are warnings being triggered on the latest JSD version due to the `RequestCacheImpl` being used outside of a request thread by the `SdSerialisedOffThreadProcessor`. This will not work in the future, so we need to fix it.
            h3. Steps to Reproduce
             # Install Jira Software v8.11

            The below exception is thrown in the Atlassian-jira.log file:
            {noformat}
            2020-07-17 13:50:05,242+0530 JMXInstrumentsLoggingService STARTING INFO      [atlassian-performance] Scheduling JMXINSTRUMENTS with poll interval of 60 seconds 2020-07-17 13:50:05,243+0530 JMXInstrumentsLoggingService STARTING

            INFO      [atlassian-performance] all services started and healthy 2020-07-17 13:50:05,243+0530 JMXInstrumentsLoggingService RUNNING WARN      [c.a.j.cache.request.RequestCacheImpl] Incorrect usage of JIRA API. You can only create/use: RequestCacheImpl inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtil for details. 2020-07-17 13:50:05,243+0530 JMXInstrumentsLoggingService RUNNING WARN      [c.a.j.cache.request.RequestCacheImpl] From Jira 9.0 version creation/usage of RequestCacheImpl will throw the IllegalStateException. 2020-07-17

            13:50:05,244+0530 JMXInstrumentsLoggingService RUNNING WARN      [c.a.j.cache.request.RequestCacheImpl] Incorrect usage of JIRA API. You can only create/use: RequestCacheImpl inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtil for details. 2020-07-17 13:50:05,244+0530 JMXInstrumentsLoggingService RUNNING WARN      [c.a.j.cache.request.RequestCacheImpl] From Jira 9.0 version creation/usage of RequestCacheImpl will throw the IllegalStateException. 2020-07-17 13:51:05,247+0530 JMXInstrumentsLoggingService RUNNING WARN      [c.a.j.cache.request.RequestCacheImpl] Incorrect usage of JIRA API. You can only create/use: RequestCacheImpl inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtil for details.
            {noformat}
            h3. Workaround
            h4. Tried workaround JSDSERVER-6897
            h4. set the package to ERROR (this setting will remain after a Jira restart)
             - Edit the file {{<JIRA_INSTALLATION>/atlassian-jira/WEB-INF/classes/log4j.properties}}
             - Add the 2 following lines at the end of the file and save it:
            {code:java}
            log4j.logger.com.atlassian.jira.cache.request.RequestCacheImpl = ERROR, filelog
            log4j.additivity.com.atlassian.jira.cache.request.RequestCacheImpl = false
            {code}

             - Restart the Jira application
            New: h3. Issue Summary

            There are warnings being triggered on the latest Jira software version due to the `RequestCacheImpl` being used outside of a request thread by the `JMXInstrumentsLoggingService`. This will not work in the future, so we need to fix it.
            h3. Steps to Reproduce
             # Install Jira Software v8.11

            The below exception is thrown in the Atlassian-jira.log file:
            {noformat}
            2020-07-17 13:50:05,242+0530 JMXInstrumentsLoggingService STARTING INFO      [atlassian-performance] Scheduling JMXINSTRUMENTS with poll interval of 60 seconds 2020-07-17 13:50:05,243+0530 JMXInstrumentsLoggingService STARTING

            INFO      [atlassian-performance] all services started and healthy 2020-07-17 13:50:05,243+0530 JMXInstrumentsLoggingService RUNNING WARN      [c.a.j.cache.request.RequestCacheImpl] Incorrect usage of JIRA API. You can only create/use: RequestCacheImpl inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtil for details. 2020-07-17 13:50:05,243+0530 JMXInstrumentsLoggingService RUNNING WARN      [c.a.j.cache.request.RequestCacheImpl] From Jira 9.0 version creation/usage of RequestCacheImpl will throw the IllegalStateException. 2020-07-17

            13:50:05,244+0530 JMXInstrumentsLoggingService RUNNING WARN      [c.a.j.cache.request.RequestCacheImpl] Incorrect usage of JIRA API. You can only create/use: RequestCacheImpl inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtil for details. 2020-07-17 13:50:05,244+0530 JMXInstrumentsLoggingService RUNNING WARN      [c.a.j.cache.request.RequestCacheImpl] From Jira 9.0 version creation/usage of RequestCacheImpl will throw the IllegalStateException. 2020-07-17 13:51:05,247+0530 JMXInstrumentsLoggingService RUNNING WARN      [c.a.j.cache.request.RequestCacheImpl] Incorrect usage of JIRA API. You can only create/use: RequestCacheImpl inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtil for details.
            {noformat}
            h3. Workaround
            h4. Tried workaround JSDSERVER-6897
            h4. set the package to ERROR (this setting will remain after a Jira restart)
             - Edit the file {{<JIRA_INSTALLATION>/atlassian-jira/WEB-INF/classes/log4j.properties}}
             - Add the 2 following lines at the end of the file and save it:
            {code:java}
            log4j.logger.com.atlassian.jira.cache.request.RequestCacheImpl = ERROR, filelog
            log4j.additivity.com.atlassian.jira.cache.request.RequestCacheImpl = false
            {code}

             - Restart the Jira application
            Danish (Inactive) created issue -

              Unassigned Unassigned
              mkhan2@atlassian.com Danish (Inactive)
              Affected customers:
              5 This affects my team
              Watchers:
              11 Start watching this issue

                Created:
                Updated:
                Resolved: