Project issues cannot be imported from Jira server in 13.1

Summary

Since an upgrade to version 13.1, a customer reports that attempting to import project issues from Jira results in no projects in the drop down. This seems to possibly be a regression since the addition of a GraphQL wrapper in Merge 28190. The issue seems to be that the get projects paginated endpoint exists for cloud hosted Jira but not on-prem Jira as noted by a post on the Atlassian help site.

Steps to reproduce

  • Have a GitLab instance running version 13.1
  • Have a Jira Server (the on-prem version not the cloud one)
  • Enable the Jira integration for your GitLab instance, following the steps for Jira Server.
  • Attempt to import any Jira project issues
  • See the projects drop down appear empty, importing cannot occur

Example Project

I was not able to reproduce on GitLab.com, only in my test self-managed GitLab instance. Used the same Jira instance for each test, I just set up a GCP server and used the free trial of Jira (version 8.5.5)

What is the current bug behavior?

Nothing populates in the drop down because the request to retrieve all projects is failing. Project issues cannot be imported as a result.

What is the expected correct behavior?

GitLab retrieves all Jira projects via the Jira API, then shows them in the drop down so that one can be selected.

Relevant logs and/or screenshots

From a test in Julian's GitLab instance, the customer saw the same one in their instance. I also saw the same error in my own replication.

{
  "severity": "ERROR",
  "time": "2020-07-17T05:16:28.643Z",
  "correlation_id": "pMe4C072J74",
  "service_class": "Jira::Requests::Projects",
  "project_id": 90,
  "project_path": "root/test-jira-project",
  "message": "Error sending message",
  "client_url": "http://127.0.0.1:7000/",
  "error": "Jira request error: {\"errorMessages\":[\"No project could be found with key 'search'.\"],\"errors\":{}}"
}
Expand for screenshots

.com

Screen_Shot_2020-07-17_at_2.46.22_PM

self-managed 13.1.1-ee

Screen_Shot_2020-07-17_at_2.49.35_PM

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
sudo gitlab-rake gitlab:env:info

System information
System:		Ubuntu 18.04
Proxy:		no
Current User:	git
Using RVM:	no
Ruby Version:	2.6.6p146
Gem Version:	2.7.10
Bundler Version:1.17.3
Rake Version:	12.3.3
Redis Version:	5.0.9
Git Version:	2.27.0
Sidekiq Version:5.2.7
Go Version:	unknown

GitLab information
Version:	13.1.1-ee
Revision:	a604fffd4ba
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	11.7
URL:		https://gitlarb.party
HTTP Clone URL:	https://gitlarb.party/some-group/some-project.git
SSH Clone URL:	git@gitlarb.party:some-group/some-project.git
Elasticsearch:	no
Geo:		no
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers:

GitLab Shell
Version:	13.3.0
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell
Git:		/opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check

sudo gitlab-rake gitlab:check

Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 13.3.0 ? ... OK (13.3.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... Tommert Keeper of Dogs / coolest-mountains ... yes Pizza Eaters / Pizza Pictures ... yes Parent Group A / Sub Group B / Project B ... yes Templates-wow / No Master Default ... yes Kaitlyn / woooooo ... yes Kaitlyn / 152258 ... yes Kaitlyn / Good Bugs ... yes Templates-wow / its-really-cake ... yes Kaitlyn / Jira Import Test ... yes Redis version >= 4.0.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.6) Git version >= 2.22.0 ? ... yes (2.27.0) Git user has default SSH configuration? ... yes Active users: ... 5 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes

Seems related to the merge to add a GraphQL wrapper for the Jira API. !28190 (merged)

Specifically this bit, where we seem to be using the search endpoint that doesn't work in on-prem Jira

https://gitlab.com/gitlab-org/gitlab/-/blob/f66a7bb589c17119bfac34df1929abf0410bd04d/app/models/project_services/jira_service.rb#L244-247

Edited by Kaitlyn Chappell (former GitLab)