Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1712811 - /katello/api/repository_sets/:id returns too many repositories
Summary: /katello/api/repository_sets/:id returns too many repositories
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API - Content
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.6.0
Assignee: Ian Ballou
QA Contact: Jitendra Yejare
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-22 09:52 UTC by Evgeni Golov
Modified: 2019-10-22 19:48 UTC (History)
1 user (show)

Fixed In Version: tfm-rubygem-katello-3.12.0.4-11.master
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-22 19:48:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 26981 0 Normal Closed /katello/api/repository_sets/:id returns too many repositories 2020-10-31 15:01:54 UTC

Description Evgeni Golov 2019-05-22 09:52:24 UTC
Description of problem:
When calling the /katello/api/repository_sets/:id API endpoint, Katello (in 6.5) will return every version/copy of a repository when it is published to multiple contentviews/environments:

GET /katello/api/repository_sets/2456
[DEBUG] Params: {
    "organization_id" => 3
}
[DEBUG] Headers: {
    :params => {
        "organization_id" => 3
    }
}
[DEBUG] Response: {
         "enabled" => true,
         "product" => {
          "id" => 9,
        "name" => "Red Hat Enterprise Linux Server"
    },
    "repositories" => [
        [   0] {
                    "id" => 86206,
                  "name" => "Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server",
                  "arch" => "x86_64",
            "releasever" => "7Server"
        },
        [   1] {
                    "id" => 86216,
                  "name" => "Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server",
                  "arch" => "x86_64",
            "releasever" => "7Server"
        },
        …
        [1544] {
                    "id" => 23549,
                  "name" => "Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server",
                  "arch" => "x86_64",
            "releasever" => "7Server"
        },
        [1545] {
                    "id" => 1,
                  "name" => "Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server",
                  "arch" => "x86_64",
            "releasever" => "7Server"
        }
    ],
            "name" => "Red Hat Enterprise Linux 7 Server (RPMs)",
          "vendor" => "Red Hat",
           "label" => "rhel-7-server-rpms",
              "id" => "2456",
            "type" => "yum",
          "gpgUrl" => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
      "contentUrl" => "/content/dist/rhel/server/7/$releasever/$basearch/os"
}


In 6.4, the response only lists the "real" repository:

[DEBUG 2019-05-22T09:35:50 API] Params: {}
[DEBUG 2019-05-22T09:35:50 API] Headers: {
    :params => {}
}
[DEBUG 2019-05-22T09:35:50 API] Response: {
         "enabled" => false,
         "product" => {
          "id" => 23,
        "name" => "Red Hat Ansible Engine"
    },
    "repositories" => [
        [0] {
                    "id" => 1,
                  "name" => "Red Hat Ansible Engine 2.6 RPMs for Red Hat Enterprise Linux 7 Server x86_64",
                  "arch" => "x86_64",
            "releasever" => nil
        }
    ],
            "name" => "Red Hat Ansible Engine 2.6 RPMs for Red Hat Enterprise Linux 7 Server",
          "vendor" => "Red Hat",
           "label" => "rhel-7-server-ansible-2.6-rpms",
              "id" => "7387",
            "type" => "yum",
          "gpgUrl" => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
      "contentUrl" => "/content/dist/rhel/server/7/7Server/$basearch/ansible/2.6/os"
}

This "breaks" Foreman Ansible Modules/Nailgun as Nailgun will query repository information for each of the 1545 repositories listed, which takes a lot of time

Version-Release number of selected component (if applicable):
Satellite 6.5

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 4 Ian Ballou 2019-06-05 21:02:41 UTC
Created redmine issue https://projects.theforeman.org/issues/26967 from this bug

Comment 5 John Mitsch 2019-06-06 15:16:04 UTC
Created redmine issue https://projects.theforeman.org/issues/26981 from this bug

Comment 6 Bryan Kearney 2019-06-13 14:05:12 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/26981 has been resolved.

Comment 8 Jitendra Yejare 2019-07-09 12:23:05 UTC
Verified!

@ Satellite 6.6 snap 10

Steps:
-------------
1. Enable RHEL7 Server repository
2. Create 2 content views and add above repository in both content views.
3. Publish content views
4. Get repository Set details of RHEL7 server reposioty
# curl -u admin:changeme -X GET https://satellite.com/katello/api/v2/repository_sets/2456 -d 'organization_id=2' --insecure


Observation:
------------------

{
  "enabled": true,
  "product": {
    "id": 67,
    "name": "Red Hat Enterprise Linux Server"
  },
  "repositories": [
    {
      "id": 8,
      "name": "Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server",
      "arch": "x86_64",
      "releasever": "7Server"
    }
  ],
  "name": "Red Hat Enterprise Linux 7 Server (RPMs)",
  "vendor": "Red Hat",
  "label": "rhel-7-server-rpms",
  "id": "2456",
  "type": "yum",
  "gpgUrl": "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
  "contentUrl": "/content/dist/rhel/server/7/$releasever/$basearch/os"
}

Comment 9 Bryan Kearney 2019-10-22 19:48:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:3172


Note You need to log in before you can comment on or make changes to this bug.