Bug 1635249 - Outputting UTF8 characters during undercloud install/upgrade fails
Summary: Outputting UTF8 characters during undercloud install/upgrade fails
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: puppet-openstacklib
Version: 13.0 (Queens)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: zstream
: 10.0 (Newton)
Assignee: Sofer Athlan-Guyot
QA Contact: Arik Chernetsky
URL:
Whiteboard:
: 1547477 1672300 (view as bug list)
Depends On: 1547477
Blocks: 1655473 1691289 1692257 1703078 1703097
TreeView+ depends on / blocked
 
Reported: 2018-10-02 13:06 UTC by Ganesh Kadam
Modified: 2024-02-26 13:45 UTC (History)
29 users (show)

Fixed In Version: puppet-openstacklib-9.5.0-4.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1547477
: 1691289 1692257 1703078 1703097 (view as bug list)
Environment:
Last Closed: 2019-04-30 16:58:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1720115 0 None None None 2018-10-02 13:06:16 UTC
Launchpad 1744075 0 None None None 2018-10-02 13:06:16 UTC
OpenStack gerrit 637816 0 None NEW Force python io encoding to be set with utf-8 2020-11-05 09:21:30 UTC
Red Hat Issue Tracker OSP-5112 0 None None None 2021-12-10 17:57:22 UTC
Red Hat Issue Tracker UPG-2708 0 None None None 2021-12-10 17:57:35 UTC
Red Hat Knowledge Base (Solution) 3251961 0 None None None 2018-10-02 13:06:16 UTC
Red Hat Product Errata RHBA-2019:0921 0 None None None 2019-04-30 16:59:10 UTC

Comment 7 mathieu bultel 2019-02-19 11:01:12 UTC
So after some discussions with Darius via email.
I had a chance to reproduce the issue.
This is present in all releases of TripleO. I reproduced it even on master.

I found several attempts in instack-undercloud or other projects to fix this kind of race.

When I was debugging it appear that the execution of the openstack command via Puppet doesn't take in account the Python io encoding environment variable.
Even if this env variable has been set on the system or in the puppet manifest (puppet-stack-config.pp for instance).

So every openstack command thrown by the puppet-openstacklib provider needs to have the python io encoding forced to utf-8.
If not, the python code return an exception due to non-ascii characters. ('ascii' codec can't encode character u'\xe9' in position 1: ordinal not in range(128))

Comment 8 John Dennis 2019-02-19 14:29:14 UTC
I don't think you want to be trying to set the Python io encoding environment variable. Python's encoding should be correctly set when the Python interpreter initializes based on the locale.
I pointed this out in the original bug in this comment https://bugzilla.redhat.com/show_bug.cgi?id=1547477#c4 and Julie's follow-up comment seems to suggest the locale is not being initialized correctly somewhere. The locale is a shell property, it is not directly tied to Python (other than the fact Python queries the execution environment to determine what it is).

I suspect what is going on is that when Puppet or any other configuration tool executes a shell on the target it is not setting the locale correctly. In fact a very common mistake is to the the locale to C which will produce these types of problems. My suggestion would be focus on the locale setting rather than on trying to fudge things with Python specific environment variables so you get to the actual root of the problem.

Comment 11 Sofer Athlan-Guyot 2019-03-05 12:40:47 UTC
Hi,

so the bottom of this problem is that, by default, puppet reset the
locale to C when executing commands[1].

We have to pass override_locale false in order to prevent that behavior.

The review there[2] does it.  I'm waiting for a little bit of feedback
before updating the attached review on the bz, but I think this is the
proper solution.

To ease debugging/validation here's how to test it:

ssh undercloud

. stackrc

openstack project create --description "A tést" tést --domain default 

cat > test.pp<<EOP
  keystone_tenant { 'test1':
  ensure => present
} 
EOP

sudo puppet apply --noop --debug test.pp

[1]  https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/execution.rb#L349-L357
[2] https://review.openstack.org/#/c/640997/

Comment 18 mbollo 2019-04-04 15:55:09 UTC
The package is ready.

Comment 19 Lukas Bezdicka 2019-04-08 11:33:17 UTC
*** Bug 1547477 has been marked as a duplicate of this bug. ***

Comment 26 errata-xmlrpc 2019-04-30 16:58:51 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, 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/RHBA-2019:0921

Comment 27 Lukas Bezdicka 2019-05-03 09:15:45 UTC
*** Bug 1672300 has been marked as a duplicate of this bug. ***


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