Bug 1893617
| Summary: | Failed to discover docker repositories because 'Content Default HTTP Proxy' is not used to connect to the registry. | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Hao Chang Yu <hyu> |
| Component: | Container Management - Content | Assignee: | Partha Aji <paji> |
| Status: | CLOSED ERRATA | QA Contact: | Lukáš Hellebrandt <lhellebr> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.7.0 | CC: | agilmore2, ehelms, spusater |
| Target Milestone: | 6.10.0 | Keywords: | Triaged |
| Target Release: | Unused | ||
| 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: | 2021-11-16 14:09:33 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: | |||
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 |
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 ------------------------------------------