You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error coming back from a linux box contains the \u2018 character which seems to have an implementation issue in python 2.x.
see - '{0}'.format(u'Test it\u2018s unicode implementation')
Traceback (most recent call last):
File "", line 1, in
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 7: ordinal not in range(128)
but run fine in python 3.x
STEPS TO REPRODUCE
Message coming back from the linux box, \u2018 is used several times :
fatal: [crlg.be-cloud.be]: FAILED! => {
"failed": true,
"msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user (rc: 1, err: chown: changing ownership of ‘/tmp/ansible-tmp-1483137683.83-3208985635661/’: Operation not permitted\nchown: changing ownership of ‘/tmp/ansible-tmp-1483137683.83-3208985635661/git.py’: Operation not permitted\n). For information on working around this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user"
}
EXPECTED RESULTS
The message should be displayed
ACTUAL RESULTS
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 119, in run
res = self._execute()
File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 490, in _execute
result = self._handler.run(task_vars=variables)
File "/usr/lib/python2.7/dist-packages/ansible/plugins/action/normal.py", line 33, in run
results = merge_hash(results, self._execute_module(tmp=tmp, task_vars=task_vars))
File "/usr/lib/python2.7/dist-packages/ansible/plugins/action/__init__.py", line 618, in _execute_module
self._fixup_perms2(remote_files, remote_user)
File "/usr/lib/python2.7/dist-packages/ansible/plugins/action/__init__.py", line 395, in _fixup_perms2
' see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user'.format(res['rc'], res['stderr']))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 29: ordinal not in range(128)
fatal: [crlg.be-cloud.be]: FAILED! => {
"failed": true,
"msg": "Unexpected failure during module execution.",
"stdout": ""
}
I fixed the problem using the "xxxx %s xxxx" % (res['rc'], res['stderr']) instead.
The text was updated successfully, but these errors were encountered:
letzdoo-js
changed the title
Use format which have problem with \u2018 characters used in some linux messages
Task executor use .format() which have problem with \u2018 characters
Dec 30, 2016
I believe this was fixed in this commit to devel: bb5d8fb and cherry-picked to the stable-2.2 branch here: 27be8a1
It should make it into the next 2.2 release. If you'd care to test it out now to make sure you can checkout the stable-2.2 branch and try running from a checkout or you can download the ansible-2.2.1.0-0.2.rc2.tar.gz from here: https://releases.ansible.com/ansible/ to try it out.
I'll close this in a few days unless you report that it's still a problem with one of those. Thanks!
ISSUE TYPE
COMPONENT NAME
ansible/plugins/action/init.py
ANSIBLE VERSION
CONFIGURATION
none
OS / ENVIRONMENT
x86_64 GNU/Linux
SUMMARY
An error coming back from a linux box contains the \u2018 character which seems to have an implementation issue in python 2.x.
see - '{0}'.format(u'Test it\u2018s unicode implementation')
Traceback (most recent call last):
File "", line 1, in
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 7: ordinal not in range(128)
but run fine in python 3.x
STEPS TO REPRODUCE
Message coming back from the linux box, \u2018 is used several times :
fatal: [crlg.be-cloud.be]: FAILED! => {
"failed": true,
"msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user (rc: 1, err: chown: changing ownership of ‘/tmp/ansible-tmp-1483137683.83-3208985635661/’: Operation not permitted\nchown: changing ownership of ‘/tmp/ansible-tmp-1483137683.83-3208985635661/git.py’: Operation not permitted\n). For information on working around this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user"
}
EXPECTED RESULTS
The message should be displayed
ACTUAL RESULTS
I fixed the problem using the "xxxx %s xxxx" % (res['rc'], res['stderr']) instead.
The text was updated successfully, but these errors were encountered: