Bug 1734404

Summary: While running insights-client getting FileNotFoundError: [Errno 2] No such file or directory: 'python': 'python'
Product: Red Hat Enterprise Linux 8 Reporter: Mahesh Yadav <mayadav>
Component: insights-clientAssignee: jcrafts
Status: CLOSED DUPLICATE QA Contact: Jeff Needle <jneedle>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.0CC: cstratak
Target Milestone: rc   
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-30 13:23:49 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 Mahesh Yadav 2019-07-30 12:58:30 UTC
Description of problem:
While running insights-client getting FileNotFoundError: [Errno 2] No such file or directory: 'python': 'python'


Version-Release number of selected component (if applicable):
This is happening on RHEL8 onwards


How reproducible:
Whenever insights is used on a fresh RHEL8 it gives an error for python as mentioned below.  


Steps to Reproduce:
1. #Install insights-client.noarch
2. #insights-client --register
3. #insights-client

Probably after second steps it will start giving error as follows:
# insights-client
Fatal error
Traceback (most recent call last):
  File "/var/lib/insights/last_stable.egg/insights/client/phase/v1.py", line 32, in _f
    func(client, config)
  File "/var/lib/insights/last_stable.egg/insights/client/phase/v1.py", line 131, in post_update
    print_egg_versions()
  File "/var/lib/insights/last_stable.egg/insights/client/utilities.py", line 262, in print_egg_versions
    env={'PYTHONPATH': egg, 'PATH': os.getenv('PATH')}, stdout=PIPE, stderr=STDOUT)
  File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'python': 'python'



Actual results:
As mentioned above it gives the result.  Although it is working but giving above error.


Expected results:
There should not be an error while running insights-client.


Additional info:
We are about to get rid of this issue by creating a simple symlink to the python package.

# sudo ln -s /usr/bin/python3 /usr/bin/python

This is just a workaround and needs fix for this.

Comment 1 Miro HronĨok 2019-07-30 13:20:10 UTC
insights-client should not run the "python" command directly but run the command from sys.executable.
The "python" command not being available unless user/admin takes an explicit action is a documented thing for RHEL8.

Comment 2 Jeff Needle 2019-07-30 13:23:49 UTC

*** This bug has been marked as a duplicate of bug 1733221 ***