RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 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...
Keywords:
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
unspecified
medium
Target Milestone: rc
: 8.0
Assignee: jcrafts
QA Contact: Jeff Needle
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
Last Closed: 2019-07-30 13:23:49 UTC
Type: Bug
Target Upstream Version:
Embargoed:


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


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