# Obscure error message in Unicode-related jinja2 template fail

**URL:** <https://forum.ansible.com/t/obscure-error-message-in-unicode-related-jinja2-template-fail/21178>\
**Category:** Ansible Project\
**Created:** [April 15, 2016, 8:57pm UTC](https://forum.ansible.com/t/obscure-error-message-in-unicode-related-jinja2-template-fail/21178 "2016-04-15T20:57:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alan\_Orth](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Alan\_Orth](https://forum.ansible.com/u/Alan_Orth)\
**Post date:** [April 15, 2016, 8:57pm UTC](https://forum.ansible.com/t/obscure-error-message-in-unicode-related-jinja2-template-fail/21178/1 "2016-04-15T20:57:37Z")

</div>

Hi,

I was trying to template PHP 7’s default pool.conf file and ran into this unhelpful error message with Ansible 2.0.1.0:

[WARNING]: Failure when attempting to use callback plugin (\<ansible.plugins.callback.default.CallbackModule object at 0x1015f3f10\>): ‘ascii’ codec can’t  
decode byte 0xc2 in position 9200: ordinal not in range(128)

I spent quite a bit of time trying to figure out what character was at position 9200, until I noticed that Ansible 2.0.0.2 and 1.9.6 give a much more useful error message:

fatal: [web01] =\> {‘msg’: ‘One or more items failed.’, ‘failed’: True, ‘changed’: False, ‘results’: [{‘msg’: “AnsibleError: file: /some/path/php7.0-pool.conf.j2, line number: 303, error: Encountered unknown tag ‘Y’.”, ‘failed’: True}]}

It turns out that line 303 is:

; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t

Deleting this line allows the template task to finish successfully. Should I file an issue on GitHub?

Thanks,

---

<div class="post-metadata">

**Author:** ![Marc\_Riepen](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@Marc\_Riepen](https://forum.ansible.com/u/Marc_Riepen)\
**Post date:** [May 4, 2016, 5:11pm UTC](https://forum.ansible.com/t/obscure-error-message-in-unicode-related-jinja2-template-fail/21178/2 "2016-05-04T17:11:56Z")

</div>

Thanks Alan, that was exactly my issue. Took me a good hour to figure it out, but only because of your post.

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [May 6, 2016, 7:47am UTC](https://forum.ansible.com/t/obscure-error-message-in-unicode-related-jinja2-template-fail/21178/3 "2016-05-06T07:47:41Z")

</div>

If there is none already, I would say yes.

Similar issue:  
[https://github.com/ansible/ansible/issues/14258](https://github.com/ansible/ansible/issues/14258)

Johannes
