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))
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.
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/
The package is ready.
*** Bug 1547477 has been marked as a duplicate of this bug. ***
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
*** Bug 1672300 has been marked as a duplicate of this bug. ***