Bug 2049674

Summary: Insights not working, 502 Bad Gateway, Backtrace for 'Action failed' error (NoMethodError): undefined method `organization' for nil:NilClass
Product: Red Hat Satellite Reporter: Stephen Wadeley <swadeley>
Component: RH Cloud - InsightsAssignee: Shimon Shtein <sshtein>
Status: CLOSED NOTABUG QA Contact: Stephen Wadeley <swadeley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.11.0CC: ahumbe, aruzicka, bbuckingham, egolov, sshtein
Target Milestone: UnspecifiedKeywords: Triaged, UserExperience
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: 2023-03-13 11:45:24 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 Stephen Wadeley 2022-02-02 14:28:18 UTC
Description of problem:

While testing global registration on a RHEL8 client, the following error was seen:

=== Begin API URL Connection Test ===
Testing: https://mysat7:443/redhat_access/r/insights/
GET https://mysat7:443/redhat_access/r/insights/
HTTP Status: 502 Bad Gateway
HTTP Response Text: {"message":"Authentication to the Insights Service failed.","headers":{}}
Connection failed
=== End API URL Connection Test: FAILURE ===

Satellite /redhat_access/r/insights/ shows:
{
  "error": {"message":"Internal Server Error: the server was unable to finish the request. This may be caused by unavailability of some required service, incorrect API call or a server-side bug. There may be more information in the server's logs."}
}


Checking Satellite production logs shows:

Backtrace for 'Action failed' error (NoMethodError): undefined method `organization' for nil:NilClass


Version-Release number of selected component (if applicable):
Sat7 snap 7
~]# rpm -q satellite
satellite-7.0.0-0.3.beta.el8sat.noarch

How reproducible:
Not sure, tested this manually a few times.
I tried two different manifests, not yet tried different tokens.



Steps to Reproduce:
1. In Satellite web Ui, Configure > Insights
2. add Red Hat Cloud token
3. Use Global Registration curl command to register a RHEL8 host

Actual results:


Expected results:
It works, or there are useful error messages and no backtrace.

Additional info:
I will attach production logs.

2049588 – [RFE] Insights token cannot be changed in web UI

Comment 2 Stephen Wadeley 2022-02-02 14:43:00 UTC
Hi 

undefined method `organization'

makes me think of:

BZ#2045854 – organization context fails to change in web UI

Comment 3 Stephen Wadeley 2022-02-02 14:56:55 UTC
Hello

It works now after loading new manifest, running satellite-installer, and loading new token.

I will attach production log again.

Thank you

Comment 29 Brad Buckingham 2023-03-06 11:38:36 UTC
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team.  Thank you.

Comment 40 Stephen Wadeley 2023-03-13 11:45:24 UTC
Hello

Example error message if you do not configure remote_execution_ssh_user as per docs[1]


  1:
[DEPRECATION WARNING]: [defaults]callback_whitelist option, normalizing names 
   2:
to new standard, use callbacks_enabled instead. This feature will be removed 
   3:
from ansible-core in version 2.15. Deprecation warnings can be disabled by 
   4:
setting deprecation_warnings=False in ansible.cfg.
   5:
[DEPRECATION WARNING]: "include" is deprecated, use include_tasks/import_tasks 
   6:
instead. This feature will be removed in version 2.16. Deprecation warnings can
   7:
 be disabled by setting deprecation_warnings=False in ansible.cfg.
   8:
[WARNING]: Callback disabled by environment. Disabling the Foreman callback
   9:
plugin.
  10:

  11:
PLAY [all] *********************************************************************
  12:

  13:
TASK [Gathering Facts] *********************************************************
  14:
fatal: [dhcp-3-114.vms.sat.rdu2.redhat.com]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added 'dhcp-XXXXXXX.redhat.com,123.XX.YY.ZZ' (ECDSA) to the list of known hosts.\r\nroot.com: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true}
  15:
PLAY RECAP *********************************************************************
  16:
dhcp-XXXXXXX.redhat.com : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0
  17:
Exit status: 1


[1] Closing this bug in favour of these:

Bug 2143980 - The "Configure Cloud Connector" job will fail to setup cloud-connector if remote_execution_ssh_user is set to a non-root user
Bug 2176085 - "Configure Cloud Connector" job can fail without obvious indication on the page
Bug 2176092 - Better docs links for Cloud Connector page