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.
Description of problem:
The 'hammer ping' command returns a 0 exit code even with a failed service.
Version-Release number of selected component (if applicable):
tfm-rubygem-hammer_cli-2.1.2-1.el7sat.noarch
How reproducible:
1. Stop a service.
# satellite-maintain service stop --only rh-mongodb34-mongod.service
2. Execute the command; note that there are FAIL statuses.
# hammer ping
database:
Status: ok
Server Response: Duration: 0ms
candlepin:
Status: ok
Server Response: Duration: 55ms
candlepin_events:
Status: ok
message: 0 Processed, 0 Failed
Server Response: Duration: 0ms
candlepin_auth:
Status: ok
Server Response: Duration: 40ms
katello_events:
Status: ok
message: 0 Processed, 0 Failed
Server Response: Duration: 0ms
pulp:
Status: FAIL
Server Response: Message: Pulp database connection issue at https://satellite.localdomain/pulp/api/v2.
pulp_auth:
Status: FAIL
Server Response: Message: Skipped pulp_auth check after failed pulp check
foreman_tasks:
Status: ok
Server Response: Duration: 5ms
3. Check the exit code.
# echo $?
0
Actual results:
Exit code is "0".
Expected results:
Exit code should be non-zero.
Additional info:
This seems this worked in the past; please reference:
Bug 1054362 - [RFE] Ping command sbould return status
based on backend services being up or down
[https://bugzilla.redhat.com/show_bug.cgi?id=1054362]
Bug 1094826 - Hammer ping command returns wrong return
code
[https://bugzilla.redhat.com/show_bug.cgi?id=1094826]
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 Tools 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:4701
Description of problem: The 'hammer ping' command returns a 0 exit code even with a failed service. Version-Release number of selected component (if applicable): tfm-rubygem-hammer_cli-2.1.2-1.el7sat.noarch How reproducible: 1. Stop a service. # satellite-maintain service stop --only rh-mongodb34-mongod.service 2. Execute the command; note that there are FAIL statuses. # hammer ping database: Status: ok Server Response: Duration: 0ms candlepin: Status: ok Server Response: Duration: 55ms candlepin_events: Status: ok message: 0 Processed, 0 Failed Server Response: Duration: 0ms candlepin_auth: Status: ok Server Response: Duration: 40ms katello_events: Status: ok message: 0 Processed, 0 Failed Server Response: Duration: 0ms pulp: Status: FAIL Server Response: Message: Pulp database connection issue at https://satellite.localdomain/pulp/api/v2. pulp_auth: Status: FAIL Server Response: Message: Skipped pulp_auth check after failed pulp check foreman_tasks: Status: ok Server Response: Duration: 5ms 3. Check the exit code. # echo $? 0 Actual results: Exit code is "0". Expected results: Exit code should be non-zero. Additional info: This seems this worked in the past; please reference: Bug 1054362 - [RFE] Ping command sbould return status based on backend services being up or down [https://bugzilla.redhat.com/show_bug.cgi?id=1054362] Bug 1094826 - Hammer ping command returns wrong return code [https://bugzilla.redhat.com/show_bug.cgi?id=1094826]