# Weird Stacktrace on Ansible Playbook Execution

**URL:** <https://forum.ansible.com/t/weird-stacktrace-on-ansible-playbook-execution/13657>\
**Category:** Ansible Project\
**Created:** [October 10, 2013, 2:11pm UTC](https://forum.ansible.com/t/weird-stacktrace-on-ansible-playbook-execution/13657 "2013-10-10T14:11:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phillip\_Verheyden](https://avatars.discourse-cdn.com/v4/letter/p/c6cbf5/32.png) [@Phillip\_Verheyden](https://forum.ansible.com/u/Phillip_Verheyden)\
**Post date:** [October 10, 2013, 2:11pm UTC](https://forum.ansible.com/t/weird-stacktrace-on-ansible-playbook-execution/13657/1 "2013-10-10T14:11:18Z")

</div>

I’m getting a pretty cryptic stack trace from the latest Ansible built from src (like 10 mins ago):

Traceback (most recent call last):  
File “/usr/local/share/python/ansible-playbook”, line 268, in   
sys.exit(main(sys.argv[1:]))  
File “/usr/local/share/python/ansible-playbook”, line 208, in main  
pb.run()  
File “/usr/local/lib/python2.7/site-packages/ansible/playbook/ **init**.py”, line 228, in run  
play = Play(self, play\_ds, play\_basedir)  
File “/usr/local/lib/python2.7/site-packages/ansible/playbook/play.py”, line 80, in **init**  
ds = self.\_load\_roles(self.roles, ds)  
File “/usr/local/lib/python2.7/site-packages/ansible/playbook/play.py”, line 288, in \_load\_roles  
roles = self.\_build\_role\_dependencies(roles, , self.vars)  
File “/usr/local/lib/python2.7/site-packages/ansible/playbook/play.py”, line 178, in \_build\_role\_dependencies  
defaults\_data = utils.parse\_yaml\_from\_file(defaults)  
File “/usr/local/lib/python2.7/site-packages/ansible/utils/ **init**.py”, line 419, in parse\_yaml\_from\_file  
process\_yaml\_error(exc, data, path)  
File “/usr/local/lib/python2.7/site-packages/ansible/utils/ **init**.py”, line 397, in process\_yaml\_error  
msg = process\_common\_errors(msg, probline, mark.column)  
File “/usr/local/lib/python2.7/site-packages/ansible/utils/ **init**.py”, line 358, in process\_common\_errors  
elif len(probline) and probline[column] == “:” and probline.find(“=”) != -1:  
IndexError: string index out of range

Where should I start debugging this? I guess there’s a YAML problem here, but it’s pretty cryptic. I suppose I’ll go through my YAML and attempt to self-parse.

---

<div class="post-metadata">

**Author:** ![James\_Cammarata1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@James\_Cammarata1](https://forum.ansible.com/u/James_Cammarata1)\
**Post date:** [October 10, 2013, 3:12pm UTC](https://forum.ansible.com/t/weird-stacktrace-on-ansible-playbook-execution/13657/2 "2013-10-10T15:12:58Z")

</div>

This was new code recently introduced to help highlight common errors. I’m guessing that the “column” value may not be zero-indexed, so when the error occurs at the end of the line it may be exceeding the string length. Could you open a github issue for this, and I’ll get you a patch ASAP?

If you’re comfortable editing the code yourself, you might want to change that one line to “column-1” to see if that resolves the issue. The file is lib/ansible/utils/ **init**.py.

---

<div class="post-metadata">

**Author:** ![Phillip\_Verheyden](https://avatars.discourse-cdn.com/v4/letter/p/c6cbf5/32.png) [@Phillip\_Verheyden](https://forum.ansible.com/u/Phillip_Verheyden)\
**Post date:** [October 10, 2013, 3:45pm UTC](https://forum.ansible.com/t/weird-stacktrace-on-ansible-playbook-execution/13657/3 "2013-10-10T15:45:16Z")

</div>

Yes, I’ll open an issue at some point today.

I discovered the problem: in one of my variable files I had the following:

varname value

As opposed to

varname: value

Fixing the typo fixed the playbook. Regardless, probably shouldn’t be a stack trace there so I’ll open the issue.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 11, 2013, 12:11am UTC](https://forum.ansible.com/t/weird-stacktrace-on-ansible-playbook-execution/13657/4 "2013-10-11T00:11:54Z")

</div>

Thanks, this is definitely something I introduced on devel.

If you can share a playbook that triggers it in the github, it will be easy to fix.
