Bug 1945916 - Foreman maintain service status command returns non "0" exit code due to some invalid services like "dynflow-sidekiq.rpmsave, dynflow-sidekiq.rpmsave"
Summary: Foreman maintain service status command returns non "0" exit code due to some...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 6.9.3
Assignee: Anurag Patel
QA Contact: Gaurav Talreja
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-02 17:02 UTC by Ashish Humbe
Modified: 2021-12-01 08:51 UTC (History)
7 users (show)

Fixed In Version: rubygem-foreman_maintain-0.7.10
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1962853 (view as bug list)
Environment:
Last Closed: 2021-07-01 14:58:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 32292 0 High New Foreman maintain service status command returns non "0" exit code due to some invalid services like "dynflow-sidekiq@orc... 2021-04-12 10:42:43 UTC
Github SatelliteQE testfm pull 263 0 None open Add test for BZ-1945916 2021-12-01 08:51:15 UTC

Description Ashish Humbe 2021-04-02 17:02:02 UTC
Description of problem:

/ All services displayed                                              [FAIL]    
Some services are not running (dynflow-sidekiq.rpmsave, dynflow-sidekiq.rpmsave)
--------------------------------------------------------------------------------
Scenario [Status Services] failed.

The following steps ended up in failing state:

  [service-status]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="service-status"


# echo $?
1

Here while checking the status of sidekiq instance services we are referring "orchestrator.yml.rpmsave" and "worker.yml.rpmsave" files 


/ displaying dynflow-sidekiq.rpmsave                           
● dynflow-sidekiq.rpmsave.service - Foreman jobs daemon - orchestrator.yml.rpmsave on sidekiq
   Loaded: loaded (/usr/lib/systemd/system/dynflow-sidekiq@.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Fri 2021-04-02 22:18:55 IST; 2min 49s ago
     Docs: https://theforeman.org
  Process: 15206 ExecStart=/usr/libexec/foreman/sidekiq-selinux -e ${RAILS_ENV} -r ${DYNFLOW_SIDEKIQ_SCRIPT} -C /etc/foreman/dynflow/%i.yml (code=exited, status=1/FAILURE)
 Main PID: 15206 (code=exited, status=1/FAILURE)

/ displaying dynflow-sidekiq.rpmsave                                 
● dynflow-sidekiq.rpmsave.service - Foreman jobs daemon - worker.yml.rpmsave on sidekiq
   Loaded: loaded (/usr/lib/systemd/system/dynflow-sidekiq@.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Fri 2021-04-02 22:18:55 IST; 2min 49s ago
     Docs: https://theforeman.org
  Process: 15205 ExecStart=/usr/libexec/foreman/sidekiq-selinux -e ${RAILS_ENV} -r ${DYNFLOW_SIDEKIQ_SCRIPT} -C /etc/foreman/dynflow/%i.yml (code=exited, status=1/FAILURE)
 Main PID: 15205 (code=exited, status=1/FAILURE)


So the exit code is returned as "1"

Comment 2 Evgeni Golov 2021-04-09 17:14:25 UTC
Trivial (untested) patch that should fix this issue:

% git diff | cat
diff --git definitions/features/dynflow_sidekiq.rb definitions/features/dynflow_sidekiq.rb
index 5d2f3d5..6169451 100644
--- definitions/features/dynflow_sidekiq.rb
+++ definitions/features/dynflow_sidekiq.rb
@@ -37,6 +37,6 @@ class Features::DynflowSidekiq < ForemanMaintain::Feature
   end
 
   def configured_instances
-    Dir['/etc/foreman/dynflow/*'].map { |config| File.basename(config, '.yml') }
+    Dir['/etc/foreman/dynflow/*.yml'].map { |config| File.basename(config, '.yml') }
   end
 end

Comment 6 Evgeni Golov 2021-04-12 10:42:41 UTC
Created redmine issue https://projects.theforeman.org/issues/32292 from this bug

Comment 9 Bryan Kearney 2021-04-13 10:15:27 UTC
Upstream bug assigned to apatel

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

Comment 11 Gaurav Talreja 2021-06-01 10:43:29 UTC
Hi,

any specific reason to move the target milestone from 6.9.3 to 6.10.0? and Devel Whiteboard also has snap_6.10.0_2.0, is it right?

As there exists a clone BZ#1962853 which has targetted for 6.10.0 already or should we mark this clone BZ as DUPLICATE?


Thanks,
Gaurav Talreja

Comment 12 James Jeffers 2021-06-01 11:08:33 UTC
@ehelm

Comment 13 James Jeffers 2021-06-01 11:09:35 UTC
Eric,

I see this was moved to 6.10 - was the intention to move it off 6.9.3?

Comment 14 Brad Buckingham 2021-06-01 13:17:00 UTC
Eric,

For 6.10, the correct bugzilla is the clone bug 1962853 and it did get moved to ON_QA.

I am moving this one back to 6.9.3; otherwise, it may get missed on the zstream.

I am also moving the state back to POST as I assume that is correct for 6.9.z; however, adding NEEDINFO so that you can keep me honest.

Thanks!

Comment 15 Gaurav Talreja 2021-06-10 18:55:36 UTC
Verified.

Tested on Satellite 6.9.3 Snap 2.0
Version: rubygem-foreman_maintain-0.7.10-1.el7sat.noarch

Setup:
1. Have any backup .rpmsave file in /etc/foreman/dynflow/
   # ls /etc/foreman/dynflow/
    orchestrator.yml  test_bz.yml.rpmsave  worker-1.yml  worker-hosts-queue-1.yml

Steps:
1. foreman-maintain service status -b

Observation:
service-status doesn't pick up any backup files like *.rpmsave, which don't exist as services.
Also, any other files with extension .yml that don't pick up by service-status, which fail eventually.

Comment 18 errata-xmlrpc 2021-07-01 14:58:46 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 Maintenance 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:2635


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