Bug 1733221 - Version logging causes a traceback on RHEL8 systems that do not have python installed.
Summary: Version logging causes a traceback on RHEL8 systems that do not have python i...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Hybrid Cloud Console (console.redhat.com)
Classification: Red Hat
Component: Client
Version: unspecified
Hardware: All
OS: All
unspecified
high
Target Milestone: ---
: ---
Assignee: jcrafts
QA Contact: Pavol Kotvan
Kevin Blake
URL:
Whiteboard:
: 1733959 1734404 1734739 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-25 13:06 UTC by Jeff Needle
Modified: 2019-11-22 13:00 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-08 15:26:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jeff Needle 2019-07-25 13:06:59 UTC
Description of problem:
With https://github.com/RedHatInsights/insights-core/pull/1855 we added logging of the client versions to the insights-client.log but the path we specify is incorrect and will fail on RHEL8 systems which do not have python installed.  The correct path should be /usr/libexec/platform-python.

Version-Release number of selected component (if applicable):
This was introduced in 3.0.112-1

How reproducible:
100%

Steps to Reproduce:
1. Set up a  which does not have python2 or python3 installed
2. Excecute insights-client --register
3. Weep

Actual results:
# 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'
Starting to collect Insights data for my-rhel8-system-without-python


Expected results:
same, but with less tracebacking because no one wants to see that. Also the version isn't being logged, which was the motivation when introducing this bug.

Additional info:
The quality engineering group is sorry that we let this bug escape and will do better in the future.

Comment 1 Jeff Needle 2019-07-29 12:19:38 UTC
*** Bug 1733959 has been marked as a duplicate of this bug. ***

Comment 2 Jeff Needle 2019-07-30 13:23:49 UTC
*** Bug 1734404 has been marked as a duplicate of this bug. ***

Comment 3 Petr Viktorin (pviktori) 2019-07-31 08:42:25 UTC
The correct path can be obtained with:

import sys
interpreter_path = sys.executable

Please use that when launching Python from Python's subprocess, rather than hardcoding the path.

Comment 4 Jeff Needle 2019-07-31 15:28:05 UTC
*** Bug 1734739 has been marked as a duplicate of this bug. ***

Comment 5 Jeff Needle 2019-08-08 15:26:22 UTC
This was fixed in core version 3.0.115-1, which is currently available.

Comment 6 Fred Uggla 2019-08-08 17:36:14 UTC
Thanks. Just to confirm, it works as expected on my systems.


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