Bug 1998119

Summary: Inappropriate error message when ping pulp3 fails
Product: Red Hat Satellite Reporter: Radek Mynar <rmynar>
Component: Satellite MaintainAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Gaurav Talreja <gtalreja>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.10.0CC: ahumbe, apatel, aupadhye, kgaikwad
Target Milestone: 6.10.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_maintain-0.8.13 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-16 13:48:21 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 Radek Mynar 2021-08-26 13:01:11 UTC
Description of problem:
Inappropriate error message "Couldn't connect to the server: undefined method `to_sym' for nil:NilClass" is shown when ping pulp3 fails during upgrade from 6.9.4 to 6.10(SNAP 14.0) due to https://bugzilla.redhat.com/show_bug.cgi?id=1996476

Version-Release number of selected component (if applicable):
6.10.0 SNAP14.0

How reproducible:
always

Steps to Reproduce:
1. Continue upgrade after content-switchover fails (as described in BZ#1996476) (maybe some other procedure that causes pulp3 to return 503?)
2. # satellite-maintain upgrade run --target-version 6.10 --whitelist "repositories-validate,repositories-setup,content-switchover"

Actual results:
Following error message is displayed
--------------------------------------------------------------------------------
Check whether all services are running using the ping call:           [FAIL]
Couldn't connect to the server: undefined method `to_sym' for nil:NilClass
--------------------------------------------------------------------------------

Expected results:
Error message should contain something like name of destination server or some different explanation, not "undefined method..."

Additional info:
# tail /var/log/foreman-maintain/foreman-maintain.log
...
D, [2021-08-25 15:58:57-0400 #77043] DEBUG -- : Called /katello/api/ping
D, [2021-08-25 15:58:57-0400 #77043] DEBUG -- : Response: 200,   {"status":"FAIL","services":{"candlepin":{"status":"ok","duration_ms":"43"},"candlepin_auth":{"status":"ok","duration_ms":"38"},"foreman_tasks":{"status":"ok","duration_ms":"3"},"katello_events":{"status":"ok","message":"0 Processed, 0 Failed","duration_ms":"0"},"candlepin_events":{"status":"ok","message":"0 Processed, 0 Failed","duration_ms":"0"},"pulp3":{"status":"FAIL","message":"503 Service Unavailable"},"pulp":{"status":"ok","duration_ms":"185"},"pulp_auth":{"status":"ok","duration_ms":"93"}}}
...

# hammer ping
...
pulp3:            
    Status:          FAIL
    Server Response: Message: 503 Service Unavailable
...

Comment 1 Gaurav Talreja 2021-09-03 07:42:33 UTC
Verified.

Tested on Satellite 6.10.0 Snap 16.0
Version: rubygem-foreman_maintain-0.8.13-2.el7sat.noarch

Setup:
1. Make pulp3 service fail in `hammer ping` with,
# foreman-maintain service stop --only pulpcore-api,pulpcore-content,pulpcore-worker@1,pulpcore-worker@2,pulpcore-worker@3,pulpcore-worker@4

Steps:
1. # foreman-maintain health check

Observation:
No more inappropriate error message like "undefined method `to_sym' for nil:NilClass" is visible when ping pulp3 fails.
--------------------------------------------------------------------------------
Check whether all services are running using the ping call:           [FAIL]
Some components are failing: foreman_tasks, pulp3
--------------------------------------------------------------------------------

Comment 4 errata-xmlrpc 2021-11-16 13:48:21 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.10 Satellite Maintenance 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/RHBA-2021:4697