Bug 1650078 - foreman-maintain cannot run package actions non interactively when stdin is removed [NEEDINFO]
Summary: foreman-maintain cannot run package actions non interactively when stdin is r...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Foreman Maintain
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Released
Assignee: Anurag Patel
QA Contact: Nikhil Kathole
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-15 10:11 UTC by Ales Dujicek
Modified: 2019-10-07 17:13 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-13 23:27:32 UTC
Target Upstream Version:
bkearney: needinfo? (apatel)


Attachments (Terms of Use)

Description Ales Dujicek 2018-11-15 10:11:53 UTC
Description of problem:

it fails to install packages when foreman-maintain does not have stdin
so it cannot be run non-interactively

# yum remove fio -y
# foreman-maintain upgrade check -y --target-version 6.4 < /dev/null
Running preparation steps required to run the next scenarios
================================================================================
Procedures::Packages::Install: 
                                                                      [FAIL]
Failed executing yum -y install fio, exit status 256
--------------------------------------------------------------------------------
Scenario [preparation steps required to run the next scenarios] failed.

The following steps ended up in failing state:

  [packages-install]

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


interesting is, that the yum command is run in the background and in the end fio is installed in the end


/var/log/foreman-maintain/foreman-maintain.log
I, [2018-11-15 11:56:30+0200 #31952]  INFO -- : === Scenario 'preparation steps required to run the next scenarios' started ===
I, [2018-11-15 11:56:30+0200 #31952]  INFO -- : --- Execution step 'Procedures::Packages::Install' [packages-install] started ---
D, [2018-11-15 11:56:30+0200 #31952] DEBUG -- : Running command yum -y install fio with stdin nil
D, [2018-11-15 11:56:30+0200 #31952] DEBUG -- : output of the command:
 
E, [2018-11-15 11:56:30+0200 #31952] ERROR -- : Failed executing yum -y install fio, exit status 256 (ForemanMaintain::Error::ExecutionError)
/usr/share/gems/gems/foreman_maintain-0.2.11/lib/foreman_maintain/utils/command_runner.rb:54:in `execution_error'
/usr/share/gems/gems/foreman_maintain-0.2.11/lib/foreman_maintain/concerns/system_helpers.rb:64:in `execute!'
/usr/share/gems/gems/foreman_maintain-0.2.11/lib/foreman_maintain/concerns/system_helpers.rb:111:in `packages_action'
/usr/share/gems/gems/foreman_maintain-0.2.11/definitions/procedures/packages/install.rb:9:in `run'
/usr/share/gems/gems/foreman_maintain-0.2.11/lib/foreman_maintain/executable.rb:139:in `__run__'
/usr/share/gems/gems/foreman_maintain-0.2.11/lib/foreman_maintain/runner/execution.rb:83:in `block (2 levels) in run'
/usr/share/gems/gems/foreman_maintain-0.2.11/lib/foreman_maintain/runner/execution.rb:107:in `capture_errors'
...
/usr/share/gems/gems/foreman_maintain-0.2.11/bin/foreman-maintain:15:in `<top (required)>'
/usr/bin/foreman-maintain:23:in `load'
/usr/bin/foreman-maintain:23:in `<main>'
I, [2018-11-15 11:56:30+0200 #31952]  INFO -- : --- Execution step 'Procedures::Packages::Install' finished ---
I, [2018-11-15 11:56:30+0200 #31952]  INFO -- : === Scenario 'preparation steps required to run the next scenarios' finished ===
I, [2018-11-15 11:56:30+0200 #31952]  INFO -- : foreman-maintain command finished with 


I saw the same error when running foreman-maintain upgrade run ... when it got to yum -y upgrade command

Version-Release number of selected component (if applicable):
rubygem-foreman_maintain-0.2.11-1.el7sat.noarch


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