Bug 1734404 - While running insights-client getting FileNotFoundError: [Errno 2] No such file or directory: 'python': 'python'
Summary: While running insights-client getting FileNotFoundError: [Errno 2] No such fi...
Status: CLOSED DUPLICATE of bug 1733221
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: insights-client
Version: 8.0
Hardware: x86_64
OS: Linux
Target Milestone: rc
: 8.0
Assignee: jcrafts
QA Contact: Jeff Needle
Depends On:
TreeView+ depends on / blocked
Reported: 2019-07-30 12:58 UTC by Mahesh Yadav
Modified: 2019-07-30 13:23 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-07-30 13:23:49 UTC
Type: Bug
Target Upstream Version:

Attachments (Terms of Use)

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
  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 ***

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