Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accented characters produce a UnicodeDecodeError when executing a playbook (ansible 1.5.3) #6655

Closed
astorije opened this issue Mar 24, 2014 · 4 comments
Labels
bug This issue/PR relates to a bug. P1 Priority 1 - Immediate Attention Required; Release Immediately After Fixed

Comments

@astorije
Copy link
Contributor

Issue Type:

Bug Report

Ansible Version:
$ ansible --version
ansible 1.5.3
Environment:
  • Ubuntu 13.10
  • Default terminal
  • UTF8-encoded playbook file (default of Sublime Text 2)
Summary:

Accented characters produce a UnicodeDecodeError when executing a playbook.

Steps To Reproduce:

I was trying to run the following task in the only play of my playbook:

- command: git config --global user.name "Jérémie Astori"
Expected Results:

The playbook should run with no error and adds the corresponding line in the .gitconfig file.

If I replace the é by standard es, the playbook is executed as expected and the .gitconfig file is properly updated.

Actual Results:
failed: [host] => {"failed": true, "parsed": false}
invalid output was: Traceback (most recent call last):
  File "[...]/.ansible/tmp/ansible-tmp-1395677797.02-229460672953352/command", line 1304, in <module>
    main()
  File "[...]/.ansible/tmp/ansible-tmp-1395677797.02-229460672953352/command", line 90, in main
    module = CommandModule(argument_spec=dict())
  File "[...]/.ansible/tmp/ansible-tmp-1395677797.02-229460672953352/command", line 377, in __init__
    self._log_invocation()
  File "[...]/.ansible/tmp/ansible-tmp-1395677797.02-229460672953352/command", line 984, in _log_invocation
    syslog.syslog(syslog.LOG_NOTICE, unicode(msg).encode('utf8'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 78: ordinal not in range(128)

FATAL: all hosts have already failed -- aborting
@astorije astorije changed the title Accented characters produce a UnicodeDecodeError when executing a playbook (ansible 1.5.3) Accented characters produce a UnicodeDecodeError when executing a playbook (ansible 1.5.3) Mar 24, 2014
@jctanner
Copy link
Contributor

@astorije this should be fixed in devel now. Please let me know otherwise.

@astorije
Copy link
Contributor Author

@jctanner Thanks a lot for the quick answer! I am using distribution packages (Ubuntu), do you know when it will be available there?

@timruffles
Copy link
Contributor

I just had the same crash, culprit was coloured output on mkdir:

(u'ecxxxxxx.eu-west-1.compute.amazonaws.com', 'Authentication or permission failure.  In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: mkdir -p $HOME/.ansible/tmp/ansible-tmp-1403871746.71-145139516386871 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1403871746.71-145139516386871 && echo $HOME/.ansible/tmp/ansible-tmp-1403871746.71-145139516386871, exited with result 1: mkdir: cannot create directory \xe2\x80\x98/home/ubuntu/.ansible/tmp/ansible-tmp-1403871746.71-145139516386871\xe2\x80\x99: No space left on device\r\n')

Traceback (most recent call last):
File "/Users/imacuser/dev/ansible/bin/ansible-playbook", line 320, in <module>
  sys.exit(main(sys.argv[1:]))
File "/Users/imacuser/dev/ansible/bin/ansible-playbook", line 260, in main
  pb.run()
File "/Users/imacuser/dev/ansible/lib/ansible/playbook/__init__.py", line 323, in run
  if not self._run_play(play):
File "/Users/imacuser/dev/ansible/lib/ansible/playbook/__init__.py", line 677, in _run_play
  if not self._run_task(play, task, False):
File "/Users/imacuser/dev/ansible/lib/ansible/playbook/__init__.py", line 453, in _run_task
  results = self._run_task_internal(task)
File "/Users/imacuser/dev/ansible/lib/ansible/playbook/__init__.py", line 408, in _run_task_internal
  results = runner.run()
File "/Users/imacuser/dev/ansible/lib/ansible/runner/__init__.py", line 1228, in run
  results = [ self._executor(h, None) for h in hosts ]
File "/Users/imacuser/dev/ansible/lib/ansible/runner/__init__.py", line 535, in _executor
  self.callbacks.on_unreachable(host, msg)
File "/Users/imacuser/dev/ansible/lib/ansible/callbacks.py", line 465, in on_unreachable
  msg = "fatal: [%s] => %s" % (host, results)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 517: ordinal not in range(128)

benpatterson pushed a commit to openedx/configuration that referenced this issue Aug 25, 2014
…rver.

The test_build_server role was failing on acceptance tests because of unicode
static assets being gathered in collectstatic for django. This was because of
this issue ansible/ansible#6655, which has been
resolved in recent ansible versions. We must override the version that is
being used by this repo, and upgrade ansible at provisioning time for
running the test_build_server role.
@Gerst20051
Copy link

this is still happening with template files that have spanish characters

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 6, 2018
@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug. P1 Priority 1 - Immediate Attention Required; Release Immediately After Fixed
Projects
None yet
Development

No branches or pull requests

6 participants