Bug 1835349 - Enabling repo on satellite 6.7 fails with " 407 Proxy Auth Required " in spite of having correct proxy details set on satellite [NEEDINFO]
Summary: Enabling repo on satellite 6.7 fails with " 407 Proxy Auth Required " in spit...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Networking
Version: 6.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-13 16:40 UTC by soham
Modified: 2023-09-07 23:08 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-06-20 11:31:10 UTC
Target Upstream Version:
Embargoed:
nalfassi: needinfo? (smajumda)


Attachments (Terms of Use)

Description soham 2020-05-13 16:40:35 UTC
Description of problem:
Enabling repo on satellite 6.7 fails with " 407 Proxy Auth Required " in spite of having correct proxy details set on satellite.

Manifest refresh, insights, repo sync works fine but enabling a repo fails.


In the file /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.14.0.20/app/lib/katello/resources/cdn.rb

        def net_http_class
          if (proxy = ::HttpProxy.default_global_content_proxy)
            uri = URI(proxy.url) #Net::HTTP::Proxy ignores port as part of the url
            Net::HTTP::Proxy("#{uri.host}#{uri.path}", uri.port, proxy.username, proxy.password)
          else
            Net::HTTP
          end
        end

proxy.username here returns empty '', instead of nil which is causing the issue for the customer.

 [17:45:44] mjia: proxy = ::HttpProxy.default_global_content_proxy
[17:45:44] mjia: => #<HttpProxy id: 2, name: "Local CNTLM instance", url: "https://10.10.10.10", username: "", password: "">
[17:45:44] mjia: irb(main):002:0> proxy.username
[17:45:44] mjia: => ""

This seems like a regression as 6.6 seems like using nil for proxy.username.


Below workaround fixed the issue:

# foreman-rake console

proxy = ::HttpProxy.default_global_content_proxy

proxy.update_attributes!(username: nil, password: nil)

exit


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 5 Leos Stejskal 2023-06-20 11:31:10 UTC
Hi, I'm closing the BZ since the 6.7 version is past its support,
if you are able to reproduce the issue on the latest version (6.13)
please reopen the BZ with updated steps to reproduce and debug logs.


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