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 1959932

Summary: Insights not working after upgrade to satellite 6.9 (HTTP Status Code: 500)
Product: Red Hat Satellite Reporter: Amar Huchchanavar <ahuchcha>
Component: RH Cloud - InsightsAssignee: Shimon Shtein <sshtein>
Status: CLOSED ERRATA QA Contact: Jameer Pathan <jpathan>
Severity: high Docs Contact:
Priority: high    
Version: 6.9.0CC: achadha, ahumbe, aruzicka, bsawyers, egolov, hyu, jalviso, jjeffers, ktordeur, mmccune, rmynar, shivagup, vijsingh, whitedm
Target Milestone: 6.9.3Keywords: PrioBumpGSS, Regression, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_rh_cloud-3.0.22 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1972770 (view as bug list) Environment:
Last Closed: 2021-07-01 14:56:52 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:
Attachments:
Description Flags
tfm-rubygem-foreman_rh_cloud-3.0.22-1.el7sat.noarch.rpm none

Description Amar Huchchanavar 2021-05-12 16:40:25 UTC
Description of problem:
'Insights' clients are failing with below error:

~~~
# insights-client --test-connection
GET https://Satellite_URL:443/redhat_access/r/insights/v1/branch_info
GET branch_info status: 200
Running Connection Tests...
=== Begin Upload URL Connection Test ===
Testing: https://Satellite_URL:443/redhat_access/r/insights/uploads/
HTTP Status Code: 500
HTTP Status Text: Internal Server Error
HTTP Response Text: {
  "error": {"message":"Connection reset by peer - SSL_connect"}
}

Connection failed
=== End Upload URL Connection Test: FAILURE ===

=== Begin API URL Connection Test ===
Testing: https://Satellite_URL:443/redhat_access/r/insights/
HTTP Status Code: 200
HTTP Status Text: OK
HTTP Response Text: {}
Successfully connected to: https://Satellite_URL:443/redhat_access/r/insights/
=== End API URL Connection Test: SUCCESS ===

Connectivity tests completed with some errors
See /var/log/insights-client/insights-client.log for more details.
~~~

Error in /var/log/insights-client/insights-client.log

2021-05-06 13:56:59,730     INFO insights.client.connection === Begin Upload URL Connection Test ===
2021-05-06 13:56:59,730  NETWORK insights.client.connection Testing: https://Satellite_URL:443/redhat_access/r/insights/uploads/
2021-05-06 13:56:59,807  NETWORK insights.client.connection HTTP Status Code: 500
2021-05-06 13:56:59,807  NETWORK insights.client.connection HTTP Status Text: Internal Server Error
2021-05-06 13:56:59,807  NETWORK insights.client.connection HTTP Response Text: {
  "error": {"message":"Connection reset by peer - SSL_connect"}
}

2021-05-06 13:56:59,807     INFO insights.client.connection Connection failed



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

# rpm -q satellite 
satellite-6.9.1-1.el7sat.noarch


How reproducible:
Always
 ENV : Insights Client -> Satellite 6.9 -> Proxy -> cloud.redhat.com

Steps to Reproduce:
1. Install Satellite 6.9 
2. Install SQUID (on a different machine) OR use existing proxy setup
3. Configure Satellite 6.9 to use the Proxy.
   https://access.redhat.com/documentation/en-us/red_hat_satellite/6.9/html-single/installing_satellite_server_from_a_connected_network/index#configuring-satellite-with-an-http-proxy_satellite
4. Go to Satellite CLI.
   - disable DNS to reproduce the issue: 
     - Edit /etc/resolv.conf and comment out all entries so that satellite can not directly communicate outside.
      OR
     - block direct connections from satellite to WAN network.

5. Try #insights-client --test-con on satellite client 
   - It will fail with an error - HTTP Status Code: 500


Actual results:

~~~
#insights-client --test-connection

GET https://Satellite_URL:443/redhat_access/r/insights/v1/branch_info
GET branch_info status: 200
Running Connection Tests...
=== Begin Upload URL Connection Test ===
Testing: https://Satellite_URL:443/redhat_access/r/insights/uploads/
HTTP Status Code: 500
HTTP Status Text: Internal Server Error
HTTP Response Text: {
  "error": {"message":"Connection reset by peer - SSL_connect"}
}
~~~


Expected results:
The request should get routed through a proxy defined on the satellite server.



WORKAROUND:
- It works fine with global proxy settings defined in - Satellite Web UI > Administer > Settings > General > HTTP(S) proxy


Additional info:
- Satellite is unable to route the Insights request via proxy defined in Satellite UI -> Infrastructure -> HTTP proxies
- CDN sync appears to be working fine.

Comment 7 Hao Chang Yu 2021-06-08 08:51:36 UTC
*** Bug 1969267 has been marked as a duplicate of this bug. ***

Comment 8 Jameer Pathan 2021-06-17 14:44:58 UTC
Verified:

Verified with:
- Satellite 6.9.3 snap 3
- tfm-rubygem-foreman_rh_cloud-3.0.22-1.el7sat.noarch

Test steps:
- Create HTTP Proxy
- Go to Settings > Content and set "Default HTTP Proxy"
- Edit /etc/resolv.conf and comment out all entries so that satellite can not directly communicate outside.
- Register a host with satellite
- Try registering host with insights

Observations:
- insights-client register/unregister/test-connection/status requests are routed through 
http proxy set using "Default HTTP Proxy"(content) setting of Satellite.
- insights-client register/unregister/status requests are routed through 
http proxy set using "HTTP(S) proxy"(General) setting of Satellite.
- test-connection doesn't work for General "HTTP(S) proxy" setting. Filed BZ#1973285

Comment 9 Mike McCune 2021-06-18 15:22:48 UTC
*** Satellite 6.9.2 Hotfix Available ***

1) Download tfm-rubygem-foreman_rh_cloud-3.0.22-1.el7sat.noarch.rpm from this bugzilla to your Satellite


2) stop services:

satellite-maintain service stop

3) Install:

rpm -Uvh tfm-rubygem-foreman_rh_cloud-3.0.22-1.el7sat.noarch.rpm

4) restart:

satellite-maintain service start

5) Migrate database

foreman-rake db:migrate

6) resume operations

Comment 10 Mike McCune 2021-06-18 15:23:14 UTC
Created attachment 1792085 [details]
tfm-rubygem-foreman_rh_cloud-3.0.22-1.el7sat.noarch.rpm

Comment 16 errata-xmlrpc 2021-07-01 14:56:52 UTC
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 (Satellite 6.9.3 Async Bug Fix Update), 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/RHBA-2021:2636