Bug 1582215 - facter command not found while Validating availability of repositories for sat64
Summary: facter command not found while Validating availability of repositories for sat64
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Kavita
QA Contact: Nikhil Kathole
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-24 14:30 UTC by Nikhil Kathole
Modified: 2021-09-09 14:13 UTC (History)
6 users (show)

Fixed In Version: foreman_maintain-0.1.6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-05 17:29:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 23792 0 Normal Closed facter command not found while Validating availability of repositories for sat64 2020-04-21 16:23:01 UTC
Red Hat Knowledge Base (Solution) 3527971 0 None None None 2018-07-11 15:35:40 UTC

Description Nikhil Kathole 2018-05-24 14:30:33 UTC
Description of problem: 

# foreman-maintain upgrade run --target-version 6.4
Running Checks before upgrading to Satellite 6.4
================================================================================
Check for verifying syntax for ISP DHCP configurations:               [OK]
--------------------------------------------------------------------------------
Check for paused tasks:                                               [OK]
--------------------------------------------------------------------------------
Check whether all services are running using hammer ping:             [OK]
--------------------------------------------------------------------------------
Check to validate candlepin database:                                 [OK]
--------------------------------------------------------------------------------
Check if EPEL repository enabled on system: 
/ Checking for presence of EPEL repository                            [OK]      
--------------------------------------------------------------------------------
Check for running tasks:                                              [OK]
--------------------------------------------------------------------------------
Check for old tasks in paused/stopped state:                          [OK]
--------------------------------------------------------------------------------
Check for pending tasks which are safe to delete:                     [OK]
--------------------------------------------------------------------------------
Check for tasks in planning state:                                    [OK]
--------------------------------------------------------------------------------
Check for recommended disk speed of pulp, mongodb, pgsql dir.: 
| Finished                                                                      

Disk speed : 264 MB/sec                                               [OK]
--------------------------------------------------------------------------------
Validate availability of repositories: 
| Validating availability of repositories for 6.4                     [FAIL]    
Failed executing facter operatingsystemmajrelease, exit status 127:
 sh: facter: command not found
--------------------------------------------------------------------------------
Scenario [Checks before upgrading to Satellite 6.4] failed.

The following steps ended up in failing state:

  [repositories-validate]

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



Version-Release number of selected component (if applicable): 
# rpm -qa | grep maintain
rubygem-foreman_maintain-0.2.2-1.el7sat.noarch


How reproducible: always


Steps to Reproduce:
1.# foreman-maintain upgrade run --target-version 6.4


Actual results: 

Validate availability of repositories: 
| Validating availability of repositories for 6.4                     [FAIL]    
Failed executing facter operatingsystemmajrelease, exit status 127:
 sh: facter: command not found
--------------------------------------------------------------------------------
Scenario [Checks before upgrading to Satellite 6.4] failed.

production.log showed

D, [2018-05-24 10:23:14-0400 #88604] DEBUG -- : Running command facter operatingsystemmajrelease with stdin nil
D, [2018-05-24 10:23:14-0400 #88604] DEBUG -- : output of the command:
 sh: facter: command not found
E, [2018-05-24 10:23:14-0400 #88604] ERROR -- : Failed executing facter operatingsystemmajrelease, exit status 127:
 sh: facter: command not found (ForemanMaintain::Error::ExecutionError)
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/utils/command_runner.rb:52:in `execution_error'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/concerns/system_helpers.rb:68:in `execute!'
/usr/share/gems/gems/foreman_maintain-0.2.2/definitions/features/downstream.rb:57:in `rh_repos'
/usr/share/gems/gems/foreman_maintain-0.2.2/definitions/features/downstream.rb:44:in `absent_repos'
/usr/share/gems/gems/foreman_maintain-0.2.2/definitions/checks/repositories/validate.rb:19:in `block in run'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/reporter/cli_reporter.rb:139:in `with_spinner'
/usr/share/gems/gems/foreman_maintain-0.2.2/definitions/checks/repositories/validate.rb:18:in `run'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/executable.rb:139:in `__run__'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/check.rb:40:in `__run__'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/runner/execution.rb:83:in `block (2 levels) in run'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/runner/execution.rb:107:in `capture_errors'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/runner/execution.rb:82:in `block in run'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/runner/execution.rb:101:in `with_metadata_calculation'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/runner/execution.rb:81:in `run'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/runner.rb:116:in `run_step'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/runner.rb:105:in `run_steps'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/runner.rb:98:in `execute_scenario_steps'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/runner.rb:51:in `run_scenario'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/upgrade_runner.rb:138:in `block in run_phase'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/upgrade_runner.rb:181:in `with_non_empty_scenario'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/upgrade_runner.rb:134:in `run_phase'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/upgrade_runner.rb:82:in `block in run'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/upgrade_runner.rb:77:in `each'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/upgrade_runner.rb:77:in `run'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/cli/upgrade_command.rb:80:in `execute'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
/usr/share/gems/gems/foreman_maintain-0.2.2/lib/foreman_maintain/cli.rb:27:in `run'
/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
/usr/share/gems/gems/foreman_maintain-0.2.2/bin/foreman-maintain:12:in `<top (required)>'
/usr/bin/foreman-maintain:23:in `load'
/usr/bin/foreman-maintain:23:in `<main>'


Expected results:
Successful Validating availability of repositories. Might be need to check if package is installed orr not. if package not installed, install it.

Additional info: Satellite was fresh installed (6.3 with puppet 4 RHEL 7.5 server).

Comment 2 Kavita 2018-06-04 05:39:16 UTC
Created redmine issue http://projects.theforeman.org/issues/23792 from this bug

Comment 3 Satellite Program 2018-06-05 08:21:26 UTC
Upstream bug assigned to kgaikwad

Comment 4 Satellite Program 2018-06-18 14:21:38 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/23792 has been resolved.

Comment 6 Christian Marineau 2018-07-11 15:35:12 UTC
The following KCS was created https://access.redhat.com/solutions/3527971

The most common root cause of this issue would be customized Env Variable, so in a way this kind of error would be expected under those conditions, since the facter command itself (outside of any foreman tools) would also not be working.

Comment 7 Nikhil Kathole 2018-08-07 12:54:14 UTC
VERIFIED

Version tested:
# rpm -qa | grep maintain
rubygem-foreman_maintain-0.2.6-1.el7sat.noarch

--------------------------------------------------------------------------------
Validate availability of repositories: 
| Validating availability of repositories for 6.4                     [OK]      
--------------------------------------------------------------------------------

# facter
-bash: facter: command not found

foreman-maintain now run factor from /usr/bin/factor.

Comment 8 Nikhil Kathole 2018-08-07 13:33:36 UTC
Moving this back to ON_QA, this also needs to verify against  foreman_maintain-0.1.6

Comment 9 Mike McCune 2018-08-10 21:53:56 UTC
This fix is not contained in  foreman_maintain-0.1.6 as we are shipping foreman_maintain-0.2.6 separately in the satellite-tools-maintenance-beta in conjunction with the 6.4 Beta coming soon. 


This will be the version used to upgrade from 6.3 to 6.4 (the 0.2.6+ versions) and will GA in conjunction with 6.4 GA into the main sat-maint repo.

Moving back to VERIFIED

Comment 10 Bryan Kearney 2020-03-05 17:29:18 UTC
The current version of foreman_maintain includes this fix.


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