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 1476386

Summary: Upgrading with an orphaned product/repository results in 404 Error on redhat repos page
Product: Red Hat Satellite Reporter: Justin Sherrill <jsherril>
Component: Subscription ManagementAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: Sanket Jagtap <sjagtap>
Severity: high Docs Contact:
Priority: medium    
Version: 6.3.0CC: bbuckingham, bcourt, ehelms, jcallaha, sjagtap
Target Milestone: UnspecifiedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-katello-3.4.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1476882 (view as bug list) Environment:
Last Closed: 2018-02-21 17:09:55 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:
Bug Depends On: 1476882    
Bug Blocks:    
Attachments:
Description Flags
RH repos enabled
none
RH repos after upgrade none

Description Justin Sherrill 2017-07-28 19:20:40 UTC
Description of problem:

After upgrading to 6.3 with an orphaned redhat repository/product, the redhat repositories page errors with a 404 from candlepin


How reproducible:
Always

Steps to Reproduce:
1.  On Satellite 6.2 (pre upgrade): Import a manifest
2.  Enable at least one repository
3.  Delete the manifest
4.  Upgrade to 6.3
5.  Visit the 'Red Hat Repositories" page

Actual results:
Error, the logs:

2017-07-28 16:03:22 33c833b3 [app] [F] 
 | RestClient::ResourceNotFound (Katello::Resources::Candlepin::Product: 404 Resource Not Found {"displayMessage":"Product with ID '367' could not be found.","requestUuid":"b3991f0f-62a2-4933-bda2-f93e9c4843f4"} (GET /candlepin/owners/Default_Organization/products/367/?include=name&include=attributes.name&include=attributes.value&include=productContent.content.contentUrl&include=productContent.content.label&include=productContent.content.modifiedProductIds&include=productContent.content.type&include=productContent.content.id&include=productContent.content.name)):


Expected results:
page loads fine

Additional info:
Note that deleting the manifest is the easiest way to reproduce this, but it can also happen if some subscription expired, or you've imported/refreshed a new manifest that doesn't contain the product that has a repository enabled (thus is orphaned).

Comment 1 Justin Sherrill 2017-07-31 16:29:27 UTC
Connecting redmine issue http://projects.theforeman.org/issues/20245 from this bug

Comment 4 Satellite Program 2017-08-08 14:07:19 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20245 has been resolved.

Comment 5 Sanket Jagtap 2017-10-27 11:36:51 UTC
Created attachment 1344266 [details]
RH repos enabled

Comment 6 Sanket Jagtap 2017-10-27 11:39:10 UTC
Created attachment 1344267 [details]
RH repos after upgrade

The manifest was deleted before upgrading.


Before Upgrade:
hammer> subscription list --organization-id 1
---|----------------------------------|-------------------------------------------------------------------------|----------|---------|--------------|-----------|----------|------------------------------|-----------|---------
ID | UUID                             | NAME                                                                    | CONTRACT | ACCOUNT | SUPPORT      | QUANTITY  | CONSUMED | END DATE                     | QUANTITY  | ATTACHED
---|----------------------------------|-------------------------------------------------------------------------|----------|---------|--------------|-----------|----------|------------------------------|-----------|---------
7  | 8a88f7815882ed6b01588b783c090260 | custom_prd_zoo                                                          |          |         |              | Unlimited | 5        | 2046-11-15T09:57:42.000+0000 | Unlimited | 5       
6  | 8a88f7815882ed6b01588b89150f0267 | product_upload                                                          |          |         |              | Unlimited | 5        | 2046-11-15T10:16:06.000+0000 | Unlimited | 5       
3  | 8a88f7815882ed6b01589a50a1f3048a | puppet                                                                  |          |         |              | Unlimited | 0        | 2046-11-18T07:08:45.000+0000 | Unlimited | 0       
1  | 8a88f78158e36ff90158fe5d44640465 | Docker                                                                  |          |         |              | Unlimited | 0        | 2046-12-07T17:24:32.000+0000 | Unlimited | 0       
24 | 8a88f7815e22b340015e22bc733700f6 | Red Hat Enterprise Linux for Virtual Datacenters, Premium               | 11045754 | 477931  | Premium      | 50        | 0        | 2022-01-01T04:59:59.000+0000 | 50        | 0       
26 | 8a88f7815e22b340015e22bc73d3015a | Red Hat Enterprise Linux Atomic Host                                    | 11047289 | 477931  | Layered      | 75        | 0        | 2022-01-01T04:59:59.000+0000 | 75        | 0       
27 | 8a88f7815e22b340015e22bc7496016e | Red Hat Satellite Employee Subscription                                 | 10843764 | 477931  | Self-Support | 50        | 2        | 2022-01-01T04:59:59.000+0000 | 50        | 2       
28 | 8a88f7815e22b340015e22bc74ea0196 | Red Hat Enterprise Linux Server, Premium (Physical or Virtual Nodes)    | 11045754 | 477931  | Premium      | 140       | 0        | 2022-01-01T04:59:59.000+0000 | 140       | 0       
29 | 8a88f7815e22b340015e22bc754001c2 | Red Hat Enterprise Linux Server, Premium (8 sockets) (Unlimited guests) | 11045754 | 477931  | Premium      | 50        | 1        | 2022-01-01T04:59:59.000+0000 | 50        | 1       
---|----------------------------------|-------------------------------------------------------------------------|----------|---------|--------------|-----------|----------|------------------------------|-----------|---------



hammer> repository list --organization-id 1
----|----------------------------------------------------------------------------------|----------------------------------------------|--------------|---------------------------------------------------------------------------------
ID  | NAME                                                                             | PRODUCT                                      | CONTENT TYPE | URL                                                                             
----|----------------------------------------------------------------------------------|----------------------------------------------|--------------|---------------------------------------------------------------------------------
62  | Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server x86_6... | Red Hat Software Collections for RHEL Server | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7.1/x86_64/rhscl/1/os         
117 | Red Hat Satellite Tools 6.2 for RHEL 7 Server RPMs x86_64                        | Red Hat Enterprise Linux Server              | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/sat-tools/6....
155 | Red Hat Satellite Tools 6.2 for RHEL 6 Server RPMs x86_64                        | Red Hat Enterprise Linux Server              | yum          | https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/sat-tools/6....
84  | Red Hat Satellite Tools 6.1 for RHEL 7 Server RPMs x86_64                        | Red Hat Enterprise Linux Server              | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/sat-tools/6....
85  | Red Hat Satellite Tools 6.1 for RHEL 6 Server RPMs x86_64                        | Red Hat Enterprise Linux Server              | yum          | https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/sat-tools/6....
116 | Red Hat Satellite Capsule 6.2 for RHEL 7 Server RPMs x86_64                      | Red Hat Satellite Capsule                    | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/sat-capsule/...
74  | Red Hat Satellite Capsule 6.1 for RHEL 7 Server RPMs x86_64                      | Red Hat Satellite Capsule                    | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/sat-capsule/...
54  | Red Hat Satellite Capsule 6.0 for RHEL 7 Server RPMs x86_64 7.1                  | Red Hat Satellite Capsule                    | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7.1/x86_64/sat-capsule/6.0/os 
145 | Red Hat Enterprise Linux Atomic Host Trees                                       | Red Hat Enterprise Linux Atomic Host         | ostree       | https://cdn.redhat.com/content/dist/rhel/atomic/7/7Server/x86_64/ostree/repo    
4   | Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server                            | Red Hat Enterprise Linux Server              | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/os             
118 | Red Hat Enterprise Linux 7 Server RPMs x86_64 7.3                                | Red Hat Enterprise Linux Server              | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7.3/x86_64/os                 
75  | Red Hat Enterprise Linux 7 Server RPMs x86_64 7.2                                | Red Hat Enterprise Linux Server              | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7.2/x86_64/os                 
55  | Red Hat Enterprise Linux 7 Server RPMs x86_64 7.1                                | Red Hat Enterprise Linux Server              | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7.1/x86_64/os                 
36  | Red Hat Enterprise Linux 7 Server - RH Common RPMs x86_64 7Server                | Red Hat Enterprise Linux Server              | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/rh-common/os   
3   | Red Hat Enterprise Linux 7 Server Kickstart x86_64 7.3                           | Red Hat Enterprise Linux Server              | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7.3/x86_64/kickstart          
2   | Red Hat Enterprise Linux 6 Server RPMs x86_64 6Server                            | Red Hat Enterprise Linux Server              | yum          | https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os             
37  | Red Hat Enterprise Linux 6 Server - RH Common RPMs x86_64 6Server                | Red Hat Enterprise Linux Server              | yum          | https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/rh-common/os   
1   | Red Hat Enterprise Linux 6 Server Kickstart x86_64 6.8                           | Red Hat Enterprise Linux Server              | yum          | https://cdn.redhat.com/content/dist/rhel/server/6/6.8/x86_64/kickstart          
53  | puppet_upload                                                                    | puppet                                       | puppet       |                                                                                 
52  | puppet6.0                                                                        | puppet                                       | puppet       | https://kbidarka.fedorapeople.org/repos/puppet-modules/                         
6   | product_upload_repo                                                              | product_upload                               | yum          |                                                                                 
99  | novaclient                                                                       | puppet                                       | puppet       |                                                                                 
107 | fedora                                                                           | Docker                                       | docker       | https://registry-1.docker.io/                                                   
5   | custom_repo_zoo                                                                  | custom_prd_zoo                               | yum          | https://inecas.fedorapeople.org/fakerepos/zoo3/                                 
----|----------------------------------------------------------------------------------|----------------------------------------------|--------------|---------------------------------------------------------------------------------




hammer> subscription delete-manifest --organization-id 1
[.........................................................................................................................................................................................................] [100%]
hammer> subscription 
--help             -h                 delete-manifest    list               manifest-history   refresh-manifest   upload             
hammer> subscription list --organization-id 1
---|----------------------------------|----------------|----------|---------|---------|-----------|----------|------------------------------|-----------|---------
ID | UUID                             | NAME           | CONTRACT | ACCOUNT | SUPPORT | QUANTITY  | CONSUMED | END DATE                     | QUANTITY  | ATTACHED
---|----------------------------------|----------------|----------|---------|---------|-----------|----------|------------------------------|-----------|---------
7  | 8a88f7815882ed6b01588b783c090260 | custom_prd_zoo |          |         |         | Unlimited | 5        | 2046-11-15T09:57:42.000+0000 | Unlimited | 5       
6  | 8a88f7815882ed6b01588b89150f0267 | product_upload |          |         |         | Unlimited | 5        | 2046-11-15T10:16:06.000+0000 | Unlimited | 5       
3  | 8a88f7815882ed6b01589a50a1f3048a | puppet         |          |         |         | Unlimited | 0        | 2046-11-18T07:08:45.000+0000 | Unlimited | 0       
1  | 8a88f78158e36ff90158fe5d44640465 | Docker         |          |         |         | Unlimited | 0        | 2046-12-07T17:24:32.000+0000 | Unlimited | 0       
---|----------------------------------|----------------|----------|---------|---------|-----------|----------|------------------------------|-----------|---------


hammer> subscription manifest-history --organization-id 1
--------|--------------------------------------------------|--------------------
STATUS  | STATUS MESSAGE                                   | TIME               
--------|--------------------------------------------------|--------------------
DELETE  | Subscriptions deleted by foreman_admin           | 2017/10/27 09:26:45
SUCCESS | Default_Organization file imported successfully. | 2017/08/27 08:08:49
DELETE  | Subscriptions deleted by foreman_admin           | 2017/08/27 08:07:39
SUCCESS | Default_Organization file imported successfully. | 2017/06/30 12:43:01
SUCCESS | Default_Organization file imported successfully. | 2017/06/30 11:51:26
DELETE  | Subscriptions deleted by foreman_admin           | 2017/06/30 11:50:02
SUCCESS | Default_Organization file imported successfully. | 2017/05/02 07:55:32
DELETE  | Subscriptions deleted by foreman_admin           | 2017/05/02 07:53:57
SUCCESS | Default_Organization file imported successfully. | 2017/02/06 09:25:08
SUCCESS | Default_Organization file imported successfully. | 2016/11/24 13:08:53
SUCCESS | Default_Organization file imported successfully. | 2016/11/24 12:58:49
DELETE  | Subscriptions deleted by admin-55ad213d          | 2016/11/24 12:58:13
SUCCESS | Default_Organization file imported successfully. | 2016/11/22 09:50:34
--------|--------------------------------------------------|--------------------

PFA , screen shot for after upgrade.

NO, errors were seen in the logs on visiting RH repos page after upgrade

Comment 7 Bryan Kearney 2018-02-21 16:44:08 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

Comment 8 Bryan Kearney 2018-02-21 17:09:55 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