JIRA
  1. JIRA
  2. JRA-8009

java.lang.IllegalStateException: getAttribute: Session already invalidated when trying to call getAvailableActions or getFieldsForAction

    Details

      Description

      I wrote a very simple SOAP client to test the available workflow actions on our system (attached). Unfortunately it sporadically crashes when calling getAvailableActions() or getFieldsForAction(), with the attached exceptions. Note that the getIssue call always seems to succeed (both before and after the crash) and I am also able to successfully add comments to actions. I have set up all the SOAP bindings to be in the package com.atlassian.jira.rpc.soapclient.

      1. cheeky_error.txt
        26 kB
        Cheeky Mini
      2. cheeky_soap.php
        4 kB
        Cheeky Mini
      3. exception.1
        2 kB
        Robert Gibson
      4. exception.2
        2 kB
        Robert Gibson
      5. jira soap error.txt
        120 kB
        Davor Barcan
      6. MyTestClient.java
        1 kB
        Robert Gibson

        Issue Links

          Activity

          Hide
          Christian Knuechel added a comment -

          Recently I had a similar issue in a web application I developed myself. I took quite some time to debug this issue but I finally found out what is causing the IllegalStateException when the session is accessed.

          The problem occured when the time to complete the HTTP request was longer then the session timout configured for the web application. In such a case Tomcat will invalidate the session when the request is still ongoing. If the web application then tries to finish up the request and tries to update a session attribute the described IllegalStateException will be thrown.

          The workaournd for this would be to set a higher session timeout for the web application. Usually this can be done in the web.xml file but I'm not sure if this is possible for JIRA or if JIRA somehow ignores/overrides the setting in the web.xml.

          Also it would be interesting to know if the error occurs just for long running request and what the default session timeout for SOAP requests is in JIRA.

          This issue has been marked as Resolved but I'm not sure if this is really the case. Maybe it should be reopened.

          Show
          Christian Knuechel added a comment - Recently I had a similar issue in a web application I developed myself. I took quite some time to debug this issue but I finally found out what is causing the IllegalStateException when the session is accessed. The problem occured when the time to complete the HTTP request was longer then the session timout configured for the web application. In such a case Tomcat will invalidate the session when the request is still ongoing. If the web application then tries to finish up the request and tries to update a session attribute the described IllegalStateException will be thrown. The workaournd for this would be to set a higher session timeout for the web application. Usually this can be done in the web.xml file but I'm not sure if this is possible for JIRA or if JIRA somehow ignores/overrides the setting in the web.xml. Also it would be interesting to know if the error occurs just for long running request and what the default session timeout for SOAP requests is in JIRA. This issue has been marked as Resolved but I'm not sure if this is really the case. Maybe it should be reopened.
          Hide
          Matt Doar (ServiceRocket) added a comment -

          I agree. Lots of the methods in the SOAP API have parameters that can be made large enough so that the operation times out., The default timeout seems to be about a minute?

          Show
          Matt Doar (ServiceRocket) added a comment - I agree. Lots of the methods in the SOAP API have parameters that can be made large enough so that the operation times out., The default timeout seems to be about a minute?
          Hide
          Erik van Zijst [Atlassian] added a comment -

          Hi Christian,

          That's an interesting insight and would imply that this only affects requests that take a long time to return. Can you confirm that this was indeed the case in your tests and never on normal, quickly returning invocations?

          We closed the issue last year after we committed a fix and we could no longer reproduce the problem. But yeah, if you are still seeing this problem on Jira 4, maybe we should reopen it.

          Cheers,
          Erik

          Show
          Erik van Zijst [Atlassian] added a comment - Hi Christian, That's an interesting insight and would imply that this only affects requests that take a long time to return. Can you confirm that this was indeed the case in your tests and never on normal, quickly returning invocations? We closed the issue last year after we committed a fix and we could no longer reproduce the problem. But yeah, if you are still seeing this problem on Jira 4, maybe we should reopen it. Cheers, Erik
          Hide
          Christian Knuechel added a comment -

          I personally cannot reproduce the problem at the moment since I do not use the JIRA SOAP API extensively anymore. I was having this problem back in 2006. Wang Yiming's comment brought up my attention for this bug again and I remembered the similar issues I had in a self-developed web application.

          The validity of my theory could be easily verified by inserting a sleep into one of the SOAP method implementations on the server side. For example the sleep could be called with a 15 minute delay and the session timeout should be configured to be 10 minutes. This should reliably provoke the IllegalStateException.

          Show
          Christian Knuechel added a comment - I personally cannot reproduce the problem at the moment since I do not use the JIRA SOAP API extensively anymore. I was having this problem back in 2006. Wang Yiming's comment brought up my attention for this bug again and I remembered the similar issues I had in a self-developed web application. The validity of my theory could be easily verified by inserting a sleep into one of the SOAP method implementations on the server side. For example the sleep could be called with a 15 minute delay and the session timeout should be configured to be 10 minutes. This should reliably provoke the IllegalStateException.
          Hide
          Eric Dalgliesh [Atlassian] added a comment -

          We are no longer actively developing JIRA's XML-RPC or SOAP APIs. We recommend using our REST APIs instead. Please see https://developer.atlassian.com/display/JIRADEV/_JIRA+API+Status for the current status of our various APIs.

          Show
          Eric Dalgliesh [Atlassian] added a comment - We are no longer actively developing JIRA's XML-RPC or SOAP APIs. We recommend using our REST APIs instead. Please see https://developer.atlassian.com/display/JIRADEV/_JIRA+API+Status for the current status of our various APIs.

            People

            • Assignee:
              Unassigned
              Reporter:
              Robert Gibson
            • Votes:
              14 Vote for this issue
              Watchers:
              23 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: