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 1940308 - [BUG] The / at the end of proxy url is not being handled by satellite correctly when trying to enable repositories
Summary: [BUG] The / at the end of proxy url is not being handled by satellite correct...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.8.0
Hardware: All
OS: All
medium
high
Target Milestone: 6.11.0
Assignee: Justin Sherrill
QA Contact: Stephen Wadeley
URL:
Whiteboard:
: 1918918 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-18 06:20 UTC by Sayan Das
Modified: 2024-06-14 00:53 UTC (History)
8 users (show)

Fixed In Version: tfm-rubygem-katello-4.3.0.2-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-05 14:28:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 34372 0 Normal New The / at the end of proxy url is not being handled correctly when trying to enable repositories' 2022-02-01 20:08:45 UTC
Red Hat Knowledge Base (Solution) 5891571 0 None None None 2021-03-18 08:46:30 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:29:24 UTC

Description Sayan Das 2021-03-18 06:20:45 UTC
Description of problem:

The / at the end of proxy URL is not being handled by satellite correctly when trying to enable repositories but works fine while syncing existing repos or refreshing manifest. 


Version-Release number of selected component (if applicable):
6.7, 6.8, and hopefully 6.9 as well

How reproducible:
Always

Steps to Reproduce:
1. Create satellite, import manifest, sync some repos

2. Drop connection to cdn.redhat.com --> iptables -I OUTPUT -d cdn.redhat.com -j DROP

3. Create a proxy server --> http://proxy.example.com:8080

4. Create a HTTP proxy in satellite,
	--> hammer http-proxy create --name myproxy --url http://proxy.example.com:8080/ --organization RedHat
	--> hammer settings set --name content_default_http_proxy --value myproxy

5. Go to Infrastructure --> HTTP proxy --> edit myproxy and perform a test connection against https://aws.amazon.com or https://access.redhat.com

6. Try refreshing manifest

7. Try enabling repos from Content --> Red Hat Repositories page


Actual results:

** Step 5 will be successful.

** Step 6 will also be successful [ at least for customers ]

** At Step 7, when we expand any repository set entry, we will not be able to see any release version or arch to enable. And the "Scan CDN" task will be successful as well.

** On Any version of satellite actual issue can be found in this way,
~~
# hammer repository-set enable --name "Red Hat Satellite Tools 6.7 (for RHEL 7 Server) (RPMs)" --organization XXXX --product "Red Hat Enterprise Linux Server" --basearch "x86_64" --releasever "7Server"
Failed to open TCP connection to http://proxy.example.com/:8080 (getaddrinfo: Name or service not known) http://proxy.example.com:8080/
~~

** On Satellite 6.8 or above, we can use the following rake.

[root@redhat ~]# echo '
  pp HttpProxy.all
  pp Katello::Product.first.cdn_resource.fetch_substitutions("/content/dist/rhel8/")
' | foreman-rake console
Loading production environment (Rails 6.0.3.1)
Switch to inspect mode.

  pp HttpProxy.all
[#<HttpProxy:0x0000000015145518
  id: 1,
  name: "proxy.example.com",
  url: "http://proxy.example.com:8080/",
  username: "",
  password: [FILTERED]>]
#<ActiveRecord::Relation [#<HttpProxy id: 1, name: "proxy.example.com", url: "http://proxy.example.com:8080/", username: "", password: [FILTERED]>]>

  pp Katello::Product.first.cdn_resource.fetch_substitutions("/content/dist/rhel8/")
Traceback (most recent call last):
        4: from lib/tasks/console.rake:5:in `block in <top (required)>'
        3: from (irb):3
        2: from katello (3.16.0.13) app/lib/katello/resources/cdn.rb:129:in `fetch_substitutions'
        1: from katello (3.16.0.13) app/lib/katello/resources/cdn.rb:99:in `get'
SocketError (Failed to open TCP connection to proxy.example.com/:3128 (getaddrinfo: Name or service not known))


As we can see the URL gets malformed here because of the / at the end of proxy URL which was used during proxy creation.

Expected results:

* Either test-connection should fail
* Or, The way during manifest refresh, the trailing / at the end of proxy URL is being ignored, in the same way, for all operations it should be done.


Additional info:

I know that we strictly mention using "--url http://proxy.example.com:8080" but It's very common among customers that they will add / at the end as that is how they have always declared the proxy in env variables.

Comment 4 Paul Dudley 2021-04-14 14:13:21 UTC
*** Bug 1918918 has been marked as a duplicate of this bug. ***

Comment 5 Justin Sherrill 2022-02-01 20:08:44 UTC
Created redmine issue https://projects.theforeman.org/issues/34372 from this bug

Comment 6 Bryan Kearney 2022-02-02 00:03:50 UTC
Upstream bug assigned to jsherril

Comment 7 Bryan Kearney 2022-02-02 00:03:53 UTC
Upstream bug assigned to jsherril

Comment 8 Bryan Kearney 2022-02-05 02:16:54 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34372 has been resolved.

Comment 13 errata-xmlrpc 2022-07-05 14:28:45 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 (Moderate: Satellite 6.11 Release), 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-2022:5498


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