Atlassian Connector for IntelliJ IDE
  1. Atlassian Connector for IntelliJ IDE
  2. PL-2898

RemoteApiException: JSONException: JSONObject["loginCount"] not found

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.0.11
    • Fix Version/s: 3.0.12
    • Component/s: Jira
    • Environment:
    • Sprint:
      3.0.12

      Description

      There is an issue I have tested on IDEA 12.1.4 and IDEA 13 EAP, with the plugin 3.0.11 and 3.0.12-SNAPSHOT.
      I open the "Project Settings" dialog window and in the tab "Servers" add new JIRA server.
      Then I push the "Test Connection" button and receive the mentioned RemoteApiException

      com.atlassian.theplugin.commons.remoteapi.RemoteApiException: username:[password 10 chars]@https://jira.company.com
      
      org.codehaus.jettison.json.JSONException: JSONObject["loginCount"] not found.
      	at com.atlassian.connector.commons.jira.rest.JiraRestSessionImpl.wrapWithRemoteApiException(JiraRestSessionImpl.java:782)
      	at com.atlassian.connector.commons.jira.rest.JiraRestSessionImpl.login(JiraRestSessionImpl.java:175)
      	at com.atlassian.connector.commons.jira.rest.JiraRestSessionImpl.testConnection(JiraRestSessionImpl.java:757)
      	at com.atlassian.connector.commons.jira.JiraRESTFacade2Impl.testServerConnection(JiraRESTFacade2Impl.java:329)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at com.atlassian.connector.commons.jira.JIRAServerFacade2Impl$1.invoke(JIRAServerFacade2Impl.java:91)
      	at $Proxy38.testServerConnection(Unknown Source)
      	at com.atlassian.connector.commons.jira.JIRAServerFacade2Impl.testServerConnection(JIRAServerFacade2Impl.java:268)
      	at com.atlassian.theplugin.commons.jira.IntelliJJiraServerFacade.testServerConnection(IntelliJJiraServerFacade.java:473)
      	at com.atlassian.theplugin.idea.config.serverconfig.ProductConnector.connect(ProductConnector.java:35)
      	at com.atlassian.theplugin.ConnectionWrapper.run(ConnectionWrapper.java:63)
      Caused by: com.atlassian.jira.rest.client.RestClientException: org.codehaus.jettison.json.JSONException: JSONObject["loginCount"] not found.
      	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:75)
      	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.postAndParse(AbstractJerseyRestClient.java:114)
      	at com.atlassian.jira.rest.client.internal.jersey.JerseySessionRestClient.login(JerseySessionRestClient.java:54)
      	at com.atlassian.connector.commons.jira.rest.JiraRestSessionImpl.setSessionCookies(JiraRestSessionImpl.java:789)
      	at com.atlassian.connector.commons.jira.rest.JiraRestSessionImpl.wrapWithRemoteApiException(JiraRestSessionImpl.java:777)
      	... 13 more
      Caused by: org.codehaus.jettison.json.JSONException: JSONObject["loginCount"] not found.
      	at org.codehaus.jettison.json.JSONObject.get(JSONObject.java:360)
      	at org.codehaus.jettison.json.JSONObject.getInt(JSONObject.java:421)
      	at com.atlassian.jira.rest.client.internal.json.LoginInfoJsonParser.parse(LoginInfoJsonParser.java:28)
      	at com.atlassian.jira.rest.client.internal.json.AuthenticationJsonParser.parse(AuthenticationJsonParser.java:32)
      	at com.atlassian.jira.rest.client.internal.json.AuthenticationJsonParser.parse(AuthenticationJsonParser.java:25)
      	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient$4.call(AbstractJerseyRestClient.java:119)
      	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:54)
      	... 17 more
      

      I have examined the documentation and figure out it is something related to to the GET method REST API request at /rest/auth/1/session
      The JSON result of that method is supposed to have the loginInfo field with the loginCount field within.
      I have examined the results of the mentioned request
      https://jira.atlassian.com/rest/auth/1/session - the loginInfo field is filled
      https://jira.company.com/rest/auth/1/session - the loginInfo field is empty
      This weird bug is truly a showstopper in the latest versions of the plugin since I can not even add the JIRA server to interact with.
      Why does the plugin require that field and why is it empty and how to fix that?
      Whether is the plugin compatible with JIRA 5.2.6 yet?

      This bug was also filed as https://jira.atlassian.com/browse/INTPLUG-335 but there seems to be no attention anymore.

      By the way, on IDEA 12.1.4 the plugin version 3.0.10 worked fine, so the bug was introduced with version 3.0.11 and still remains there.

        Issue Links

          Activity

          Hide
          Ilia Sretenskii added a comment -

          Janusz Gorycki, I am glad to see this bug is fixed so quickly.

          I have already tried the "Check Now" button of the "General" tab of the plugin's "Global Settings", but it says I have the latest version (3.0.12-SNAPSHOT, SVN:1309092000).

          But how can I update the installed plugin now?

          Show
          Ilia Sretenskii added a comment - Janusz Gorycki , I am glad to see this bug is fixed so quickly. I have already tried the "Check Now" button of the "General" tab of the plugin's "Global Settings", but it says I have the latest version (3.0.12-SNAPSHOT, SVN:1309092000). But how can I update the installed plugin now?
          Hide
          Janusz Gorycki added a comment -

          the bug is not fixed just yet - I have only scheduled it for fixing rather soon

          Show
          Janusz Gorycki added a comment - the bug is not fixed just yet - I have only scheduled it for fixing rather soon
          Hide
          Ilia Sretenskii added a comment -

          Thanks for for the fix, Janusz!

          Show
          Ilia Sretenskii added a comment - Thanks for for the fix, Janusz!

            People

            • Assignee:
              Janusz Gorycki
              Reporter:
              Ilia Sretenskii
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Agile

                  Who's Looking?