Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1305002

Summary: When a Repository is removed from the Satellite Server, packages are still available in the Capsule Server
Product: Red Hat Satellite Reporter: anerurka
Component: Foreman ProxyAssignee: John Mitsch <jomitsch>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1.6CC: bbuckingham, bkearney, jalviso, jomitsch, sthirugn
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:51:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description anerurka 2016-02-05 09:48:59 UTC
Description of problem:

When a Repository is removed from the Satellite Server, packages are still available in the Capsule Server

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

Satellite Server v.6.1.6

How reproducible:

Steps to Reproduce:

>>> Over the Satellite Server :

1. Disable a Repository from the Satellite Server

Log in to Satellite --> Content --> Red Hat Repository --> Unchecked the Repository that needs to be disabled

2. Clear the Orphan Packages over the Capsule Server:

# foreman-rake katello:delete_orphaned_content RAILS_ENV=production >/dev/null

3. Execute Capsule sync from the Satellite Server

# hammer capsule content synchronize --id <ID>

4. Clear the yum cache over the Content host registered through the Capsule Server:

# rm -rf /var/cache/yum/*
# yum clean all

Actual results:

# yum repolist  >>> It still list the disabled repository

Expected results:

# yum repolist  >>> It should not list the disabled repository

Comment 5 Brad Buckingham 2016-07-24 16:17:58 UTC
Created redmine issue http://projects.theforeman.org/issues/15821 from this bug

Comment 6 John Mitsch 2016-07-26 15:04:19 UTC
When recreating and checking yum repolist, I am seeing 0 repos listed for the repo and an error in finding the repomd.xml file for that repository.

A subscription-manager clean and re-registering removed this error.

I an investigating if this is an error of subscription-manager or Satellite.

[root@capsule-snap-rhel7 ~]# yum clean all; yum repolist
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Cleaning repos: rhel-7-server-rh-common-rpms
Cleaning up everything
Loaded plugins: product-id, search-disabled-repos, subscription-manager
https://sat-snap-rhel7.example.com/pulp/repos/Default_Organization/Library/content/dist/rhel/server/7/7Server/x86_64/rh-common/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article 

https://access.redhat.com/articles/1320623

If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.

https://sat-snap-rhel7.example.com/pulp/repos/Default_Organization/Library/content/dist/rhel/server/7/7Server/x86_64/rh-common/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
repo id                                                                             repo name                                                                                     status
rhel-7-server-rh-common-rpms/7Server/x86_64                                         Red Hat Enterprise Linux 7 Server - RH Common (RPMs)                                          0
repolist: 0

Comment 7 John Mitsch 2016-07-26 18:34:24 UTC
The content isn't being cleared when a repository is disabled. This is actually a different issue as the content isn't available to yum. The issue is currently being worked on and I filed it here.

https://bugzilla.redhat.com/show_bug.cgi?id=1360430

Can we test that when a repository is disabled, the associated capsule no longer has the actual content available? yum repolist should show 0 packages available for that repo

Comment 14 Satellite Program 2018-02-21 16:51:07 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-2018:0336