Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-30408

JIRA REST API requests lead to 404 (not found)

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Some REST API calls cause the JIRA instance to respond with a 404:

      <status>
       <status-code>404</status-code>
       <message>null for uri: ...</message>
      </status>
      

      The problem shows up when JIRA site URL is set to something like: http://example.com/jira/.

      For example, when the REST client requests available project versions, no versions are displayed in Jenkins and the log reports:

      Sep 11, 2015 1:23:22 PM hudson.plugins.jira.JiraRestService getVersions
      WARNING: jira rest client get versions error. cause: Not Found
      

        Attachments

          Activity

          Hide
          edef Enrico De Fent added a comment -

          I've created a pull request with a patch that solves this:
          https://github.com/jenkinsci/jira-plugin/pull/61

          I was able to test it only using our JIRA instance which responds from an URL with a non-null path component. It should be tested with URLs without path components.

          Show
          edef Enrico De Fent added a comment - I've created a pull request with a patch that solves this: https://github.com/jenkinsci/jira-plugin/pull/61 I was able to test it only using our JIRA instance which responds from an URL with a non-null path component. It should be tested with URLs without path components.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Enrico De Fent
          Path:
          src/main/java/hudson/plugins/jira/JiraRestService.java
          src/test/java/hudson/plugins/jira/JiraRestServiceTest.java
          http://jenkins-ci.org/commit/jira-plugin/89f80ba5bfeb4115a418e643b9a14c35b41c12f5
          Log:
          JENKINS-30408 Fixed URI composition for REST API calls

          Take into account the base path of JIRA site URL when
          building URIs for REST API calls.

          Added a test case for checking REST API path
          construction.

          Fixes: JENKINS-30408

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Enrico De Fent Path: src/main/java/hudson/plugins/jira/JiraRestService.java src/test/java/hudson/plugins/jira/JiraRestServiceTest.java http://jenkins-ci.org/commit/jira-plugin/89f80ba5bfeb4115a418e643b9a14c35b41c12f5 Log: JENKINS-30408 Fixed URI composition for REST API calls Take into account the base path of JIRA site URL when building URIs for REST API calls. Added a test case for checking REST API path construction. Fixes: JENKINS-30408
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Radosław Antoniuk
          Path:
          src/main/java/hudson/plugins/jira/JiraRestService.java
          src/test/java/hudson/plugins/jira/JiraRestServiceTest.java
          http://jenkins-ci.org/commit/jira-plugin/2aefe9361907f649dfa9270d0ead5cf38ba02d83
          Log:
          Merge pull request #61 from edef/JENKINS-30408

          JENKINS-30408 Fixed URI composition for REST API calls

          Compare: https://github.com/jenkinsci/jira-plugin/compare/00e439d3e45e...2aefe9361907

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Radosław Antoniuk Path: src/main/java/hudson/plugins/jira/JiraRestService.java src/test/java/hudson/plugins/jira/JiraRestServiceTest.java http://jenkins-ci.org/commit/jira-plugin/2aefe9361907f649dfa9270d0ead5cf38ba02d83 Log: Merge pull request #61 from edef/ JENKINS-30408 JENKINS-30408 Fixed URI composition for REST API calls Compare: https://github.com/jenkinsci/jira-plugin/compare/00e439d3e45e...2aefe9361907
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Enrico De Fent
          Path:
          src/main/java/hudson/plugins/jira/JiraRestService.java
          src/test/java/hudson/plugins/jira/JiraRestServiceTest.java
          http://jenkins-ci.org/commit/jira-plugin/3413f8c852fcbb35e8b2afcba6fadc17bbce36a0
          Log:
          JENKINS-30408 Fixed URI composition for REST API calls

          Take into account the base path of JIRA site URL when
          building URIs for REST API calls.

          Added a test case for checking REST API path
          construction.

          Fixes: JENKINS-30408

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Enrico De Fent Path: src/main/java/hudson/plugins/jira/JiraRestService.java src/test/java/hudson/plugins/jira/JiraRestServiceTest.java http://jenkins-ci.org/commit/jira-plugin/3413f8c852fcbb35e8b2afcba6fadc17bbce36a0 Log: JENKINS-30408 Fixed URI composition for REST API calls Take into account the base path of JIRA site URL when building URIs for REST API calls. Added a test case for checking REST API path construction. Fixes: JENKINS-30408

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            edef Enrico De Fent
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: