Bug 1372377

Summary: Browsing Repositories with debug certificate provides incorrect URL for RPMs
Product: Red Hat Satellite Reporter: Dylan Gross <dgross>
Component: WebUIAssignee: Walden Raines <walden>
Status: CLOSED ERRATA QA Contact: Ivan Necas <inecas>
Severity: medium Docs Contact:
Priority: high    
Version: 6.2.0CC: bbuckingham, bkearney, dgross, dlobatog, inecas, jcallaha, walden
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/17549
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:17 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 Dylan Gross 2016-09-01 14:24:23 UTC
Description of problem:

   After downloading and importing Debugging Certificate into browser, browsing a Repo's "Published At" URL will have invalid links for the Packages.  

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

   Satellite 6.2

How reproducible:   Always


Steps to Reproduce:
1.   Download, convert, and import "Debugging Certificate" into browser.
2.   Go to "Content" > "Content View" > (CV name) > 
     "Yum Content" > "Repositories" > (Repo Name)
3.   Click the "Published At" link. It will list the packages.
4.   Click on any Package link

Actual results:

   404 Not found.  
  
   The link for the package leaves off the part of the path.

Example:  

(Incorrect)
   https://farmkvmr7n15.example.com/pulp/repos/Default_Organization/Library/content/dist/rhel/server/7/7Server/x86_64/sat-tools/6.1/facter-1.7.6-2.1.el7sat.x86_64.rpm

Expected results:

Package should start download.
In this example, the URL for the package that DOES download has /os/ in it.  Other examples (for like kickstart repos) would be /kickstart/ or a custom repo name. 

(Correct)
   https://farmkvmr7n15.example.com/pulp/repos/Default_Organization/Library/content/dist/rhel/server/7/7Server/x86_64/sat-tools/6.1/os/facter-1.7.6-2.1.el7sat.x86_64.rpm

Additional info:

   Workaround - When you first click the URL in the "Published At" field and it lists the packages, the download links don't work.   However, if you click the "Parent Directory" and then drill back down to the package listing, the links will work and will download correctly.

Comment 4 Brad Buckingham 2016-11-03 18:16:21 UTC
Hi Dylan,  I just tried this on a Satellite 6.2.3 install and was able to browse and download rpms using the link provided in the UI.  

Can you confirm if this is still an issue for you on 6.2.3?

On my config, I was testing with the following RH repo: Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server

After syncing the repo, viewing the info on it from the UI showed the following:

Published At https://sat-snap-rhel7.example.com/pulp/repos/Default_Organization/Library/content/dist/rhel/server/7/7Server/x86_64/os/

Notice that the link did correctly include the 'os'.

Comment 5 Brad Buckingham 2016-11-03 18:25:18 UTC
Dylan, clearing the NEEDINFO.  I was able to reproduce the issue with the tools repo from the original description, but not with 7Server from comment 1.

Comment 6 Dylan Gross 2016-11-09 19:20:16 UTC
Hey Brad, 
After upgrading my lab to Satellite 6.2.3, I am still able to reproduce as well, even for the 7Server repository.

Yes, the 'os' still shows up on the page that says "Published At".  But if I click on that and get the directory listing, which is still the URL that ends in /os, each RPM's link does *not* include the "/os/" in the path

Comment 7 Brad Buckingham 2016-11-09 21:35:23 UTC
Walden, per our discussion in irc, can you take a look at solving this one?

It appears that angularjs is stripping the trailing '/' from the 'Published At' URL for a repository and resulting in the behavior observed.

Comment 8 Walden Raines 2016-11-14 15:04:56 UTC
(In reply to Brad Buckingham from comment #7)
> Walden, per our discussion in irc, can you take a look at solving this one?
> 
> It appears that angularjs is stripping the trailing '/' from the 'Published
> At' URL for a repository and resulting in the behavior observed.

Yeah, I'm happy to have a look

Comment 9 Walden Raines 2016-12-01 15:04:29 UTC
Created redmine issue http://projects.theforeman.org/issues/17549 from this bug

Comment 10 Bryan Kearney 2016-12-01 17:02:27 UTC
Upstream bug component is Uncategorized

Comment 11 Walden Raines 2016-12-07 03:51:01 UTC
PR: https://github.com/Katello/bastion/pull/146

Comment 12 Bryan Kearney 2016-12-16 19:07:46 UTC
Upstream bug component is WebUI

Comment 13 Satellite Program 2017-01-03 20:21:35 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17549 has been resolved.

Comment 14 Daniel Lobato Garcia 2017-01-27 08:43:35 UTC
Setting as triaged as there's a fix already upstream

Comment 15 Ivan Necas 2017-08-16 07:35:29 UTC
Verified.

Version Tested: Satellite-6.3 Snap 11
             
Verification steps:

1. synchronize a repository with 'Immediate' download policy
2. download import a debug cert
3. navigate to the repository 'Published at' directory
4. find a package in the directories and try to download and install it
5. package installed successfully on my system

Comment 16 Satellite Program 2018-02-21 16:54:17 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