Error: Another issue tracker is already in use

Full error may appear as follow:

Another issue tracker is already in use. Only one issue tracker service can be active at a time.

This error can appear when a project has multiple JiraService records, this is especially plausible after a GitLab upgrade.

To fix this error:

  1. Ensure that all your schema migrations are up.
  2. Ensure that your Background migrations size is 0.
  3. In a Rails Console Execute the following snippet:
    • Snippet purpose: Destroy all JiraService records for each of the projects that has more than one record.
    • :warning: :warning: WARNING :warning: :warning:: For each of these projects any custom Jira configurations will be permanently lost, you’ll have to navigate to each of the projects’ settings and manually re-configure Jira.
# Find all project IDs with more than 1 Jira service record
Service.where(type: "JiraService").group(:project_id).count.select {|_, v| v > 1}.keys.each { |key|
  #
  # For each Project
  #
  p=Project.find_by_id(key)
  # Skip if project is `nil`
  next if p.nil?
  # Get all JiraService IDs for Project p
  p.services.where(type: "JiraService").each { |s|
    #
    # For each ID destroy
    #
    p.services.find_by_id(s).destroy
  }
}