Bug 1826248 - [4.4][ovirt-cockpit-sso] Compatibility issues with python3
Summary: [4.4][ovirt-cockpit-sso] Compatibility issues with python3
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-cockpit-sso
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ovirt-4.4.0
: ---
Assignee: Lev Veyde
QA Contact: Beni Pelled
URL:
Whiteboard:
Depends On:
Blocks: 1789733
TreeView+ depends on / blocked
 
Reported: 2020-04-21 10:15 UTC by Beni Pelled
Modified: 2020-08-04 13:22 UTC (History)
6 users (show)

Fixed In Version: ovirt-cockpit-sso-0.1.4-1.el8ev
Doc Type: Bug Fix
Doc Text:
Previously, the 'Host console SSO' feature did not work with python3, which is the default python on RHEL 8. The code was initially written for Python2 and was not properly modified for Python3. The current release fixes this issue: The 'Host console SSO' feature works with Python3.
Clone Of:
Environment:
Last Closed: 2020-08-04 13:22:22 UTC
oVirt Team: Integration
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-cockpit-sso pull 24 0 None closed Fix Python3 compatibility issue 2021-01-06 12:44:01 UTC
Github oVirt ovirt-cockpit-sso pull 25 0 None closed More python3 fixes 2021-01-06 12:44:01 UTC
Github oVirt ovirt-cockpit-sso pull 26 0 None closed Pycodestyle fixes 2021-01-06 12:44:01 UTC
Github oVirt ovirt-cockpit-sso pull 27 0 None closed Fix Python3 encoding issue 2021-01-06 12:44:01 UTC
Github oVirt ovirt-cockpit-sso pull 28 0 None closed Fix private key handling issue 2021-01-06 12:44:01 UTC
Red Hat Product Errata RHSA-2020:3247 0 None None None 2020-08-04 13:22:43 UTC

Description Beni Pelled 2020-04-21 10:15:41 UTC
Description of problem:
Currently, the 'Host console SSO' feature can't be used with python3 (default RHEL8) due to compatibility issues with python3

Version-Release number of selected component (if applicable):
- ovirt-cockpit-sso-0.1.3-2.el8ev.noarch
- RHV 4.4.0-0.33.master.el8ev
- Red Hat Enterprise Linux 8.2 (host)

How reproducible:
100%

Steps to Reproduce:
1. Start the ovirt-cockpit-sso.service on the engine
2. Connect to a host by 'Host Console' from the engine-UI

Actual results:
Connection to the host fails with 'Internal error in login process' and python issues appear in journalctl:

    Apr 21 13:02:24 compute-ge-10.scl.lab.tlv.redhat.com systemd[1]: Starting oVirt-Cockpit SSO service...
    Apr 21 13:02:24 compute-ge-10.scl.lab.tlv.redhat.com prestart.sh[147314]: /bin/ln: failed to create symbolic link '/usr/share/ovirt-cockpit-sso/config/cockpit/ws-certs.d/ws-certs.d': File exists
    Apr 21 13:02:24 compute-ge-10.scl.lab.tlv.redhat.com systemd[1]: Started oVirt-Cockpit SSO service.
    Apr 21 13:02:24 compute-ge-10.scl.lab.tlv.redhat.com start.sh[147321]: Installed cockpit version: 211.3
    Apr 21 13:02:24 compute-ge-10.scl.lab.tlv.redhat.com start.sh[147321]: Cockpit version check passed
    Apr 21 13:02:24 compute-ge-10.scl.lab.tlv.redhat.com cockpit-ws[147327]: Using certificate: /usr/share/ovirt-cockpit-sso/config/cockpit/ws-certs.d/0-self-signed.cert
    Apr 21 13:02:43 compute-ge-10.scl.lab.tlv.redhat.com start.sh[147321]: Traceback (most recent call last):
    Apr 21 13:02:43 compute-ge-10.scl.lab.tlv.redhat.com start.sh[147321]:   File "/usr/share/ovirt-cockpit-sso/cockpit-auth-ovirt", line 4, in <module>
    Apr 21 13:02:43 compute-ge-10.scl.lab.tlv.redhat.com start.sh[147321]:     import urlparse
    Apr 21 13:02:43 compute-ge-10.scl.lab.tlv.redhat.com start.sh[147321]: ModuleNotFoundError: No module named 'urlparse'

Expected results:
Connection to the host console by SSO 

Additional info:
In addition to the urlparse issue, there are a few more problems with encode/decode etc.

Comment 2 Lev Veyde 2020-04-22 11:52:10 UTC
Can you please provide any specific info related to the "In addition to the urlparse issue, there are a few more problems with encode/decode etc." note?

So that we could decide if it's worth to open a new bug for these issues.

Comment 3 Beni Pelled 2020-04-22 12:03:41 UTC
(In reply to Lev Veyde from comment #2)
> Can you please provide any specific info related to the "In addition to the
> urlparse issue, there are a few more problems with encode/decode etc." note?

I mentioned this specifically about /usr/share/ovirt-cockpit-sso/cockpit-auth-ovirt
for example, if I fix the urlparse problem I encounter more problems later in the file, ex:

    Apr 22 14:58:28 compute-ge-10.scl.lab.tlv.redhat.com start.sh[6570]:   File "/usr/share/ovirt-cockpit-sso/cockpit-auth-ovirt", line 50, in send_auth_command
    Apr 22 14:58:28 compute-ge-10.scl.lab.tlv.redhat.com start.sh[6570]:     os.write(1, "{}\n\n{}".format(len(text)+1, text))
    Apr 22 14:58:28 compute-ge-10.scl.lab.tlv.redhat.com start.sh[6570]: TypeError: a bytes-like object is required, not 'str'

Comment 6 Beni Pelled 2020-06-09 10:23:43 UTC
Verified with:
- ovirt-engine-4.4.0-0.37.master.el8ev.noarch
- ovirt-cockpit-sso-0.1.4-1.el8ev.noarch
- libvirt-6.0.0-17.module+el8.2.0+6257+0d066c28.x86_64
- vdsm-4.40.14-1.el8ev.x86_64


Verification steps:
1. Make sure 'ovirt-cockpit-sso.service' is running on the engine
2. Go to the Hosts window, select one of the hosts and select 'Host Console'

Result:
- A new window opens with the cockpit service - authenticated by SSO

Comment 10 errata-xmlrpc 2020-08-04 13:22:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: RHV Manager (ovirt-engine) 4.4 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:3247


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