Bug 1388699

Summary: [RFE] Satellite should be more forgiving of an incorrect listing file
Product: Red Hat Satellite Reporter: Bryan Kearney <bkearney>
Component: RepositoriesAssignee: Andrew Kofink <akofink>
Status: CLOSED ERRATA QA Contact: Renzo Nuccitelli <rnuccite>
Severity: urgent Docs Contact:
Priority: high    
Version: 6.2.0CC: akofink, bbuckingham, bkearney, cwelton, ehelms, rnuccite
Target Milestone: UnspecifiedKeywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 17:06:57 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:

Description Bryan Kearney 2016-10-25 23:52:10 UTC
If a listing file is pointing to an invalid sub-directory then this should be raised as a warning, but the repo enablement and sync pages should handle the case and allow users to sync those directories which are correct.

Comment 2 Brad Buckingham 2017-03-16 13:49:05 UTC
Created redmine issue http://projects.theforeman.org/issues/18934 from this bug

Comment 3 Andrew Kofink 2017-04-17 14:15:44 UTC
Bryan,

Could you please give some more info on this? Specifically, I'd like to know what the error message is and in which specific circumstances you get the error.

Comment 4 Bryan Kearney 2017-04-23 21:57:14 UTC
Andrew, I can not find the error message. The steps to recreate are have a listing file and no subdirectory underneath it. Today, that keeps the sync process from working at all.

Comment 5 Andrew Kofink 2017-04-28 13:59:11 UTC
In the repo enablement page, this doesn't appear to be an issue upstream. An error is shown in the logs, but the page still successfully loads all the existing directories in the listing file (note, I added 7.4 to the listing file for testing purposes):

2017-04-28T13:08:07 1393a9cd [app] [D] CDN: Requesting path https://cdn.redhat.com:443/content/dist/rhel/server/7/listing
2017-04-28T13:08:31 1393a9cd [app] [D] CDN: Requesting path https://cdn.redhat.com:443/content/dist/rhel/server/7/7.0/listing
2017-04-28T13:08:31 1393a9cd [app] [D] CDN: Requesting path https://cdn.redhat.com:443/content/dist/rhel/server/7/7.2/listing
2017-04-28T13:08:31 1393a9cd [app] [D] CDN: Requesting path https://cdn.redhat.com:443/content/dist/rhel/server/7/7.4/listing
2017-04-28T13:08:31 1393a9cd [app] [D] CDN: Requesting path https://cdn.redhat.com:443/content/dist/rhel/server/7/7.3/listing
2017-04-28T13:08:31 1393a9cd [app] [D] CDN: Requesting path https://cdn.redhat.com:443/content/dist/rhel/server/7/7Server/listing
2017-04-28T13:08:31 1393a9cd [app] [D] CDN: Requesting path https://cdn.redhat.com:443/content/dist/rhel/server/7/7.1/listing
2017-04-28T13:08:32 1393a9cd [app] [E] CDN loading error: https://cdn.redhat.com:443/content/dist/rhel/server/7/7.4/listing not found
2017-04-28T13:08:32 1393a9cd [foreman-tasks/dynflow] [D]          Step 454da74f-6649-4cff-a055-1b611cec93b9: 2   running >>   success in phase      Run Actions::Katello::RepositorySet::ScanCdn
2017-04-28T13:08:32 1393a9cd [foreman-tasks/dynflow] [D] ExecutionPlan 454da74f-6649-4cff-a055-1b611cec93b9      running >>   stopped
2017-04-28T13:08:32 cbe789b6 [app] [I]   Rendered /home/vagrant/katello/app/views/katello/providers/redhat/_repos.html.erb (28.7ms)
2017-04-28T13:08:32 cbe789b6 [app] [I] Completed 200 OK in 25723ms (Views: 36.0ms | ActiveRecord: 53.2ms)


Same thing with the API/CLI (again, I added 7.4):

$ hammer repository-set available-repositories --product-id 57 --name "Red Hat Enterprise Linux 7 Server (RPMs)"
-----------------------------------------|--------|---------|---------------|--------
NAME                                     | ARCH   | RELEASE | REGISTRY NAME | ENABLED
-----------------------------------------|--------|---------|---------------|--------
Red Hat Enterprise Linux 7 Server (RPMs) | x86_64 | 7.0     |               | no     
Red Hat Enterprise Linux 7 Server (RPMs) | x86_64 | 7.1     |               | no     
Red Hat Enterprise Linux 7 Server (RPMs) | x86_64 | 7.2     |               | no     
Red Hat Enterprise Linux 7 Server (RPMs) | x86_64 | 7.3     |               | no     
Red Hat Enterprise Linux 7 Server (RPMs) | x86_64 | 7Server |               | yes    
-----------------------------------------|--------|---------|---------------|--------

Server logs:

2017-04-28T13:51:39 1393a9cd [app] [D] CDN: Requesting path https://cdn.redhat.com:443/content/dist/rhel/server/7/listing
2017-04-28T13:51:59 1393a9cd [app] [D] CDN: Requesting path https://cdn.redhat.com:443/content/dist/rhel/server/7/7.1/listing
2017-04-28T13:51:59 1393a9cd [app] [D] CDN: Requesting path https://cdn.redhat.com:443/content/dist/rhel/server/7/7Server/listing
2017-04-28T13:51:59 1393a9cd [app] [D] CDN: Requesting path https://cdn.redhat.com:443/content/dist/rhel/server/7/7.3/listing
2017-04-28T13:51:59 1393a9cd [app] [D] CDN: Requesting path https://cdn.redhat.com:443/content/dist/rhel/server/7/7.4/listing
2017-04-28T13:51:59 1393a9cd [app] [D] CDN: Requesting path https://cdn.redhat.com:443/content/dist/rhel/server/7/7.0/listing
2017-04-28T13:51:59 1393a9cd [app] [D] CDN: Requesting path https://cdn.redhat.com:443/content/dist/rhel/server/7/7.2/listing
2017-04-28T13:52:00 1393a9cd [app] [E] CDN loading error: https://cdn.redhat.com:443/content/dist/rhel/server/7/7.4/listing not found
2017-04-28T13:52:00 1393a9cd [foreman-tasks/dynflow] [D]          Step bad9fef2-cdc4-4df0-b015-18e3f38fdbdc: 2   running >>   success in phase      Run Actions::Katello::RepositorySet::ScanCdn
2017-04-28T13:52:01 1393a9cd [foreman-tasks/dynflow] [D] ExecutionPlan bad9fef2-cdc4-4df0-b015-18e3f38fdbdc      running >>   stopped
2017-04-28T13:52:01 18395a61 [app] [I]   Rendered /home/vagrant/katello/app/views/katello/api/v2/repository_sets/available_repositories.json.rabl within katello/api/v2/layouts/collection (4.9ms)
2017-04-28T13:52:01 18395a61 [app] [D] Body: { ... }
 | 
2017-04-28T13:52:01 18395a61 [app] [I] Completed 200 OK in 23309ms (Views: 7.9ms | ActiveRecord: 42.2ms)
2017-04-28T13:52:01 18395a61 [app] [D] With body: { ... }


Is this not the behavior you are seeing on 6.2.z and/or 6.3/latest?
Also, which repo sync page that scans the CDN are you talking about? I can only find 2 places where the ScanCdn action occurs, and both are in the `available_repositories` action of the two controllers (products web UI and repo sets API).

Comment 6 Bryan Kearney 2017-05-05 17:42:44 UTC
This is what i would expect to see. I am moving this to POST for 6.3 and removing the zStream release since this is working as designed.

Comment 7 Renzo Nuccitelli 2017-09-26 15:34:46 UTC
I was able to list and also sync content as posted on comment 5. I did it on Satellite 6.3 snap 18 on both UI and CLI. So I'm moving this BZ to VERIFIED.

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