Skip to content

Fetching Jira issue types via `-/services/jira/test` returns 500 error when using a self-hosted Jira instance

Summary

Fetching a Jira project's issue types via the -/services/jira/test endpoint from a self-hosted Jira instance results in a 500 error:

JIRA::HTTPError at /h5bp/html5-boilerplate/-/services/jira/test
===============================================================

> {"errorMessages":["not a valid scheme id: project"],"errors":{}}

lib/gitlab/jira/http_client.rb, line 15
---------------------------------------

''' ruby
   10   
   11         override :request
   12         def request(*args)
   13           result = make_request(*args)
   14   
>  15           raise JIRA::HTTPError.new(result.response) unless result.response.is_a?(Net::HTTPSuccess)
   16   
   17           result
   18         end
   19   
   20         override :make_cookie_auth_request
'''

Steps to reproduce

  1. Go to a GitLab Project's Jira Integration settings (settings -> integrations -> Jira)
  2. Enter the URL of a self-hosted Jira instance into the 'Web URL' input
  3. Enter credentials and the Jira project key
  4. Either click 'Test settings' or the 'Fetch issue types' button next to the 'Select issue type' dropdown

Example Project

https://gitlab.com/gitlab-org/threat-management/secure/threat-insights/jira-test/-/services/jira/edit

(Set up to use a self-hosted instance with the error showing up)

What is the current bug behavior?

Fetching Jira issue types causes a 500 error.

What is the expected correct behavior?

The endpoint returns the list of Jira issue types.

Relevant logs and/or screenshots

jira-vulns.log.txt

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Implementation plan

Edited by Michał Zając