Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1969267

Summary: rh_cloud doesn't use the configured default global content proxy to forward the insights requests from client
Product: Red Hat Satellite Reporter: Hao Chang Yu <hyu>
Component: RH Cloud - InsightsAssignee: Shimon Shtein <sshtein>
Status: CLOSED DUPLICATE QA Contact: Jameer Pathan <jpathan>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: aruzicka
Target Milestone: Unspecified   
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-06-08 08:51:36 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 Hao Chang Yu 2021-06-08 05:58:32 UTC
Description of problem:
A Satellite that needs to use http proxy to connect to the internet is not able to forward the insights requests from the clients to the insights server. This is because the Foreman "rh_cloud" plugin doesn't use the configured default global content http proxy to connect to the insights server.

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


Steps to Reproduce:
1. In the Satellite, use the firewall to block the outgoing connection to "cert-api.access.redhat.com"

systemctl start firewalld
iptables -A OUTPUT -d <IP of cert-api.access.redhat.com> -j DROP

2. Run ping to ensure the IP is blocked successfully.

ping cert-api.access.redhat.com

3. Configure the default global content http proxy.

Web UI -> Administer -> Settings -> Content -> Default HTTP Proxy -> Select the proxy to use.

4. Ensure this http proxy is not set.

Web UI -> Administer -> Settings -> HTTP(S) proxy -> Not set

5. Login to the client, run the insights connection test.

insights-client --test-connection


Actual results:
### On client ###
GET https://satellite.example.com:443/redhat_access/r/insights/v1/branch_info
GET branch_info status: 200
Running Connection Tests...
=== Begin Upload URL Connection Test ===
Testing: https://satellite.example.com:443/redhat_access/r/insights/uploads/
HTTP Status Code: 500
HTTP Status Text: Internal Server Error
HTTP Response Text: {
  "error": {"message":"Timed out reading data from server"}
}

### OpenTimeout is raised in Satellite production.log ###
2021-06-08T15:15:02 [I|app|d7200c1e] Started GET "/redhat_access/r/insights/v1/branch_info" for XXX.XXX.XXX.XXX at 2021-06-08 15:15:02 +1000
2021-06-08T15:15:02 [I|app|d7200c1e] Processing by InsightsCloud::Api::MachineTelemetriesController#branch_info as JSON
2021-06-08T15:15:02 [I|app|d7200c1e] Completed 200 OK in 101ms (Views: 0.3ms | ActiveRecord: 16.4ms | Allocations: 11868)
2021-06-08T15:15:02 [I|app|22b260ff] Started POST "/redhat_access/r/insights/uploads/" for XXX.XXX.XXX.XXX  at 2021-06-08 15:15:02 +1000
2021-06-08T15:15:02 [I|app|22b260ff] Processing by InsightsCloud::Api::MachineTelemetriesController#forward_request as JSON
2021-06-08T15:15:02 [I|app|22b260ff]   Parameters: {"test"=>"test", "path"=>"uploads"}
2021-06-08T15:16:02 [W|app|22b260ff] Action failed
2021-06-08T15:16:02 [I|app|22b260ff] Backtrace for 'Action failed' error (RestClient::Exceptions::OpenTimeout): Timed out connecting to server
 22b260ff | /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.2/lib/restclient/request.rb:731:in `rescue in transmit'
 22b260ff | /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.2/lib/restclient/request.rb:642:in `transmit'
 22b260ff | /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.2/lib/restclient/request.rb:145:in `execute'
 22b260ff | /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.2/lib/restclient/request.rb:52:in `execute'
 22b260ff | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-3.0.18.1/app/services/foreman_rh_cloud/cloud_request_forwarder.rb:37:in `execute_cloud_request'
 22b260ff | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-3.0.18.1/app/services/foreman_rh_cloud/cloud_request_forwarder.rb:19:in `forward_request'
 22b260ff | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-3.0.18.1/app/controllers/insights_cloud/api/machine_telemetries_controller.rb:17:in `forward_request'
 22b260ff | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.4/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
 22b260ff | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.4/lib/abstract_controller/base.rb:195:in `process_action'
 22b260ff | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.4/lib/action_controller/metal/rendering.rb:30:in `process_action'
 22b260ff | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.4/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
 22b260ff | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.4/lib/active_support/callbacks.rb:112:in `block in run_callbacks'
 22b260ff | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
<snip>


Expected results:
Requests can be forwarded successfully through the configured default global content http proxy


Additional info:
This issue seems to be fixed upstream

https://github.com/theforeman/foreman_rh_cloud/pull/547


Each request has a open timeout of 60 seconds. Therefore, this will overload the Puma connection threads when many clients make concurrent insights requests. Causing http status 503 error to other http requests, such as YUM

Comment 2 Hao Chang Yu 2021-06-08 08:51:36 UTC

*** This bug has been marked as a duplicate of bug 1959932 ***