Description of problem: The Satellite that needs to connect to the RHSM/CDN via a HTTP Proxy failed to discover docker repositories (Web UI -> Content -> Products -> Click Repo Discovery) because Satellite doesn't use the 'Content Default HTTP Proxy' when connecting to the docker registry. How to reproduce: 1. In Satellite block outgoing port 443 to simulate no the no internet connection. firewall-cmd --direct --add-rule ipv4 filter OUTPUT 1 -p tcp -m tcp --dport=443 -j REJECT 2. Try to discover the registry.redhat.io in Web UI -> Content -> Products -> Click Repo Discovery. You should get connection refused error. 3. Add a http proxy in Web UI -> Infrastructure -> Http Proxies -> New Http Proxy 4. Set the added http proxy as Web UI -> Settings -> Content -> Default HTTP Proxy 5. Again, try to discover the registry.redhat.io in Web UI -> Content -> Products -> Click Repo Discovery. Actual results: Discovery failed. Error: Failed to open TCP connection to registry.redhat.io:443 (Connection refused - connect(2) for "registry.redhat.io" port 443) Expected results: Discover successfully Additional info: However, it can connect successfully after setting the http proxy in Setting -> General -> HTTP(S) proxy In 'app/lib/katello/repo_discovery.rb' ------------------------------------ def docker_search params = { :accept => :json } params[:user] = @upstream_username unless @upstream_username.empty? params[:password] = @upstream_password unless @upstream_password.empty? begin results = RestClient.get(@uri.to_s + "v1/search?q=#{@search}", params) <====== ####'default_global_content_proxy' is not set here. If Setting[:http_proxy] is set then it will be used. #### JSON.parse(results)['results'].each do |result| @found << result['name'] end rescue # Note: v2 endpoint does not support search results = RestClient.get(@uri.to_s + "v2/_catalog", params) <====== ####'default_global_content_proxy' is not set here. If Setting[:http_proxy] is set then it will be used. #### @found = JSON.parse(results)['repositories'] end @found.sort! end ------------------------------------------
Created redmine issue https://projects.theforeman.org/issues/32036 from this bug
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32036 has been resolved.
Verified. Version tested: Satellite-6.10.0 snap 5 Steps followed: 1. In Satellite block outgoing port 443 to simulate no the no internet connection. firewall-cmd --direct --add-rule ipv4 filter OUTPUT 1 -p tcp -m tcp --dport=443 -j REJECT 2. Try to discover the registry.redhat.io in Web UI -> Content -> Products -> Click Repo Discovery. You should get connection refused error. 3. Add a http proxy in Web UI -> Infrastructure -> Http Proxies -> New Http Proxy 4. Set the added http proxy as Web UI -> Settings -> Content -> Default HTTP Proxy 5. Again, try to discover the registry.redhat.io in Web UI -> Content -> Products -> Click Repo Discovery. Observation: Discovery failed. Error: Failed to open TCP connection to registry.redhat.io:443 (Connection refused - connect(2) for "registry.redhat.io" port 443) Additional info: Tried setting the HTTPS proxy through Settings -> General -> HTTPS Proxy which did not connect successfully as suggested in the original filing (Discovery failed. Error: Failed to open TCP connection to registry.redhat.io:443 (Connection refused - connect(2) for "registry.redhat.io" port 443))
Comment 3 is confusing and not base for verification. Verifying myself. Verified with Sat 6.10.0 snap 9.0. In steps 2) and 5) of a reproducer from OP, I got "Discovery failed. Error: Failed to open TCP connection to registry.redhat.io:443 (Connection refused - connect(2) for "registry.redhat.io" port 443)" as expected since direct connection is not available and no proxy is set. I created a HTTP proxy on another machine using Tinyproxy, with port 8080 (otherwise, selinux would block connection on the Satellite side). In Satellite, in Infrastructure -> HTTP Proxies, I created a proxy with URL http://<FQDN>:8080 and selected this proxy in Administer -> Settings -> Content -> Default HTTP Proxy. After trying to discover again, discovery worked as expected.
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.10 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-2021:4702
Older duplicate closed as WONTFIX: https://bugzilla.redhat.com/show_bug.cgi?id=1893617
(In reply to agilmore2 from comment #9) > Older duplicate closed as WONTFIX: > https://bugzilla.redhat.com/show_bug.cgi?id=1893617 Er https://bugzilla.redhat.com/show_bug.cgi?id=1637079
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days