Bug 1835349

Summary: Enabling repo on satellite 6.7 fails with " 407 Proxy Auth Required " in spite of having correct proxy details set on satellite
Product: Red Hat Satellite Reporter: soham <smajumda>
Component: NetworkingAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.7.0CC: hyu, lstejska, mjia, nalfassi
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: UnusedFlags: nalfassi: needinfo? (smajumda)
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: 2023-06-20 11:31:10 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:
Embargoed:

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.