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 1941240 - The 'hammer ping' Command Returns A 0 Exit Code Even With Failed Service
Summary: The 'hammer ping' Command Returns A 0 Exit Code Even With Failed Service
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.8.0
Hardware: x86_64
OS: Linux
high
medium
Target Milestone: 6.10.0
Assignee: Oleh Fedorenko
QA Contact: Shweta Singh
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-21 01:47 UTC by Bernie Hoefer
Modified: 2024-06-14 00:56 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:39:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 30496 0 Normal Closed hammer ping returns 0 even when services are in a failed state 2021-04-07 15:10:31 UTC
Red Hat Product Errata RHBA-2021:4701 0 None None None 2021-11-16 14:39:12 UTC

Description Bernie Hoefer 2021-03-21 01:47:51 UTC
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]

Comment 1 Oleh Fedorenko 2021-04-07 15:10:30 UTC
Connecting redmine issue https://projects.theforeman.org/issues/30496 from this bug

Comment 2 Bryan Kearney 2021-04-13 10:14:42 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/30496 has been resolved.

Comment 8 errata-xmlrpc 2021-11-16 14:39:05 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 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


Note You need to log in before you can comment on or make changes to this bug.