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.

Bug 1650078

Summary: foreman-maintain cannot run package actions non interactively when stdin is removed
Product: Red Hat Satellite Reporter: Ales Dujicek <adujicek>
Component: Satellite MaintainAssignee: Anurag Patel <apatel>
Status: CLOSED NOTABUG QA Contact: Nikhil Kathole <nkathole>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: apatel, bkearney, inecas, kgaikwad, mbacovsk, mmccune
Target Milestone: ReleasedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-13 23:27:32 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 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

Comment 7 Red Hat Bugzilla 2023-09-14 04:42:25 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days