Bug 1476386 - Upgrading with an orphaned product/repository results in 404 Error on redhat repos page
Upgrading with an orphaned product/repository results in 404 Error on redhat...
Status: VERIFIED
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Subscription Management (Show other bugs)
6.3.0
Unspecified Unspecified
medium Severity high (vote)
: Beta
: --
Assigned To: Justin Sherrill
Sanket Jagtap
: Regression, Triaged
Depends On: 1476882
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-28 15:20 EDT by Justin Sherrill
Modified: 2017-10-27 07:39 EDT (History)
5 users (show)

See Also:
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:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
RH repos enabled (104.77 KB, image/png)
2017-10-27 07:36 EDT, Sanket Jagtap
no flags Details
RH repos after upgrade (79.36 KB, image/png)
2017-10-27 07:39 EDT, Sanket Jagtap
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 20245 None None None 2017-07-31 12:29 EDT

  None (edit)
Description Justin Sherrill 2017-07-28 15:20:40 EDT
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 12:29:27 EDT
Connecting redmine issue http://projects.theforeman.org/issues/20245 from this bug
Comment 4 pm-sat@redhat.com 2017-08-08 10:07:19 EDT
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 07:36 EDT
Created attachment 1344266 [details]
RH repos enabled
Comment 6 Sanket Jagtap 2017-10-27 07:39 EDT
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

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