stx-openstack upload fails on Debian - TypeError: Password should be a unicode string, not bytes

Bug #1998231 reported by Thales Elero Cervi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
High
Thales Elero Cervi

Bug Description

Brief Description
-----------------
When trying to upload the stx-openstack application on Debian for the first time, it was noticed that the Python2 to Python3 upgrade requires an update on the application python plugins that get a string from a cmd execution that is no longer stored as Unicode by default, but rather as bytes.

Severity
--------
Critical: stx-openstack application can not be uploaded

Steps to Reproduce
------------------
* Upload stx-openstack application using system application-upload

Expected Behavior
------------------
Application is successfully uploaded.

Actual Behavior
----------------
Application upload fails.

Reproducibility
---------------
Reproducible

System Configuration
--------------------
AIO-SX

Branch/Pull Time/Commit
-----------------------
master:
* starlingx/master/debian/monolithic/20221128T070000Z

Last Pass
---------
N/A

Timestamp/Logs
--------------
2022-11-23 12:51:06.105 69083 ERROR sysinv.conductor.kube_app TypeError: Password should be a unicode string, not bytes.
2022-11-23 12:51:06.105 69083 ERROR sysinv.conductor.kube_app
sysinv 2022-11-23 12:51:06.182 69083 ERROR sysinv.conductor.kube_app [-] Application upload aborted!.
sysinv 2022-11-23 12:51:06.183 69083 ERROR sysinv.openstack.common.rpc.amqp [-] Exception during message handling: sysinv.common.exception.KubeAppUploadFailure: Upload of application stx-openstack (1.0-1.stx.4) fa
iled: Password should be a unicode string, not bytes.

Test Activity
-------------
Developer Testing

Workaround
----------
None

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-armada-app (master)
Changed in starlingx:
status: New → In Progress
Changed in starlingx:
assignee: nobody → Thales Elero Cervi (tcervi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-armada-app (master)

Reviewed: https://review.opendev.org/c/starlingx/openstack-armada-app/+/866045
Committed: https://opendev.org/starlingx/openstack-armada-app/commit/a41e35174fd17dfdc1f3bed09ef49017f00b3a86
Submitter: "Zuul (22348)"
Branch: master

commit a41e35174fd17dfdc1f3bed09ef49017f00b3a86
Author: Thales Elero Cervi <email address hidden>
Date: Tue Nov 29 13:28:28 2022 -0300

    Decode cmd return string for keyring password

    When running the application on Debian, now on Python 3 strings are
    stored as Byte Strings instead of Unicode Strings. The return of cmd
    execution that is stored as a Byte String is problematic for keyring
    password saving function, that requires an Unicode string.

    This change simply decode the bytes to Unicode, so the plugin is now
    compatible with Python 3. By Duck Typing it, the plugin will still be
    compatible with Python 2 for ensuring upgrades are still possible.

    TEST PLAN:
    PASS - Build stx-openstack-helm-fluxcd package
    PASS - Run build-helm-charts.sh (build app)
    PASS - Upload stx-openstack app on Debian
    PASS - Upload stx-openstack app on CentOS

    Closes-Bug: 1998231

    Signed-off-by: Thales Elero Cervi <email address hidden>
    Change-Id: Ib28bca757c1946513e0b7bc57d4c22937842587a

Changed in starlingx:
status: In Progress → Fix Released
tags: added: stx.8.0
tags: added: stx.distro.openstack
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.