Skip to content

Jira: Failed to configure Jira Marketplace app for self-managed

This is a follow-up to #386827 (closed), but it got closed / split up in multiple separate issues, but the 401/422 error wasn't.


Steps taken

Gitlab

  • Enabled FF for jira_connect_oauth and jira_connect_oauth_self_managed
  • Created application with api permissions and callback URI to our instance (https://xxxxxxxxxxxxxxxxxxx/-/jira_connect/oauth_callbacks)
  • Added the application ID to the GitLab for Jira App section in the Admin interface
  • Created a temporary public testing (due to #388152 (closed))

Atlassian / Jira side

  • Create a Jira Marketplace vendor
  • Create a private application pointing towards our https://xxxxxxxxxxxxxxxxxxx//-/jira_connect/app_descriptor.json
  • Creating a token for the application
  • Click "Upload app" in Jira Apps and paste the link generated by marketplace.

Problem

When configuring we get the option for SaaS or Self-Managed. If we choose the latter, it asks for the Instance URL.

Upon providing the URL (with or without a trailing /), Jira shows an error:

Failed to update GitLab version. Please try again.

I have tested this on Chrome (while being signed in to Jira & GitLab) and on Firefox (only signed in to Jira). The error remains the same, for the latter I am not getting a request to login either.

Logs

The logs of the webservice container:

POST /-/jira_connect/events/installed

This call results in 401 returned by GitLab.

{
   "component":"gitlab",
   "subcomponent":"production_json",
   "level":"info",
   "method":"POST",
   "path":"/-/jira_connect/events/installed",
   "format":"*/*",
   "controller":"JiraConnect::EventsController",
   "action":"installed",
   "status":401,
   "time":"2023-01-23T13:40:58.284Z",
   "params":[
      {
         "key":"clientKey",
         "value":"xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      },
      {
         "key":"jwt",
         "value":"[FILTERED]"
      },
      {
         "key":"eventType",
         "value":"installed"
      },
      {
         "key":"sharedSecret",
         "value":"[FILTERED]"
      },
      {
         "key":"baseUrl",
         "value":"https://xxxxxxxxxxxxxxxxxxxxx"
      }
   ],
   "correlation_id":"xxxxxxxxxxxxxxxxxxxxxxxxxx",
   "meta.caller_id":"JiraConnect::EventsController#installed",
   "meta.remote_ip":"xxxxxxxxxxx",
   "meta.feature_category":"integrations",
   "meta.client_id":"ip/xxxxxxxxxxx",
   "remote_ip":"xxxxxxxxxxx",
   "ua":"Ruby"
}

PUT /-/jira_connect/installations

This call results in a 422 returned by GitLab, even though the user has more than adequate permissions.

{
   "component":"gitlab",
   "subcomponent":"production_json",
   "level":"info",
   "method":"PUT",
   "path":"/-/jira_connect/installations",
   "format":"html",
   "controller":"JiraConnect::InstallationsController",
   "action":"update",
   "status":422,
   "time":"2023-01-23T13:40:58.339Z",
   "params":[
      {
         "key":"jwt",
         "value":"[FILTERED]"
      },
      {
         "key":"installation",
         "value":{
            "instance_url":"https://xxxxxxxxxxxxxxxx"
         }
      }
   ],
   "correlation_id":"xxxxxxxxxxxxxxxxxxxxxxxxxx",
   "meta.caller_id":"JiraConnect::InstallationsController#update",
   "meta.remote_ip":"xxxxxxxxxxxxx",
   "meta.feature_category":"integrations",
   "meta.user":"xxxxxxx",
   "meta.user_id":xxxxxxx,
   "meta.client_id":"user/xxxxxxx",
   "remote_ip":"xxxxxxxxxxxxx",
   "user_id":xxxxxxx,
   "username":"xxxxxxxxxx"   
}
Edited by Frank Klaassen