# \[Ansible to Windows\] IndexError: tuple index out of range

**URL:** <https://forum.ansible.com/t/ansible-to-windows-indexerror-tuple-index-out-of-range/16008>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [August 22, 2014, 6:25am UTC](https://forum.ansible.com/t/ansible-to-windows-indexerror-tuple-index-out-of-range/16008 "2014-08-22T06:25:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zhenkai\_Jiang](https://avatars.discourse-cdn.com/v4/letter/z/71c47a/32.png) [@Zhenkai\_Jiang](https://forum.ansible.com/u/Zhenkai_Jiang)\
**Post date:** [August 22, 2014, 6:25am UTC](https://forum.ansible.com/t/ansible-to-windows-indexerror-tuple-index-out-of-range/16008/1 "2014-08-22T06:25:31Z")

</div>

Hi All,

I am a very newbie to Ansible. I am running Ansible 1.8-dev from source (Tried 1.7.1 from pip as well)

I wanted to control windows machine So I setuped the workstation (Centos 6.3) followed steps on [http://docs.ansible.com/intro\_windows.html](http://docs.ansible.com/intro_windows.html)

Below is what I got:

[root@ansible-test-1 ~]# ansible windows -i ~/hosts -m win\_ping --ask-vault-pass -vvvv  
Vault password:  
\<15.126.222.251\> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 15.126.222.251  
\<15.126.222.251\> WINRM CONNECT: transport=plaintext endpoint=[https://15.126.222.251:5986/wsman](https://15.126.222.251:5986/wsman)  
15.126.222.251 | FAILED =\> Traceback (most recent call last):  
File “/root/ansible/lib/ansible/runner/ **init**.py”, line 566, in \_executor  
exec\_rc = self.\_executor\_internal(host, new\_stdin)  
File “/root/ansible/lib/ansible/runner/ **init**.py”, line 678, in \_executor\_internal  
return self.\_executor\_internal\_inner(host, self.module\_name, self.module\_args, inject, port, complex\_args=complex\_args)  
File “/root/ansible/lib/ansible/runner/ **init**.py”, line 849, in \_executor\_internal\_inner  
conn = self.connector.connect(actual\_host, actual\_port, actual\_user, actual\_pass, actual\_transport, actual\_private\_key\_file)  
File “/root/ansible/lib/ansible/runner/connection.py”, line 44, in connect  
self.active = conn.connect()  
File “/root/ansible/lib/ansible/runner/connection\_plugins/winrm.py”, line 132, in connect  
self.protocol = self.\_winrm\_connect()  
File “/root/ansible/lib/ansible/runner/connection\_plugins/winrm.py”, line 90, in \_winrm\_connect  
err\_msg = str(exc.args[0])  
IndexError: tuple index out of range

Any advices? Really appreciated that.

---

<div class="post-metadata">

**Author:** ![Avinash\_Singh](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@Avinash\_Singh](https://forum.ansible.com/u/Avinash_Singh)\
**Post date:** [August 22, 2014, 1:25pm UTC](https://forum.ansible.com/t/ansible-to-windows-indexerror-tuple-index-out-of-range/16008/2 "2014-08-22T13:25:15Z")

</div>

I am experiencing the same issue.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [August 22, 2014, 1:54pm UTC](https://forum.ansible.com/t/ansible-to-windows-indexerror-tuple-index-out-of-range/16008/3 "2014-08-22T13:54:24Z")

</div>

This is probably the same issue as what is mentioned at [https://github.com/ansible/ansible/issues/8720](https://github.com/ansible/ansible/issues/8720)

However, without the traceback in the issue I am unsure.

The specific traceback that you are seeing, is masking the real issue. The real issue likely occurred earlier causing the initial WinRMTransportError exception to be raised.

---

<div class="post-metadata">

**Author:** ![Joe\_G1](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@Joe\_G1](https://forum.ansible.com/u/Joe_G1)\
**Post date:** [August 22, 2014, 3:05pm UTC](https://forum.ansible.com/t/ansible-to-windows-indexerror-tuple-index-out-of-range/16008/4 "2014-08-22T15:05:38Z")

</div>

I found this issue started happening to me after this update of pywinrm: [https://github.com/diyan/pywinrm/tree/7ab74a4b8fbeb2af707c5628703c485f8d14238d](https://github.com/diyan/pywinrm/tree/7ab74a4b8fbeb2af707c5628703c485f8d14238d)

So, I started using an earlier version:  
pip install [https://github.com/diyan/pywinrm/archive/df049454a9309280866e0156805ccda12d71c93a.zip](https://github.com/diyan/pywinrm/archive/df049454a9309280866e0156805ccda12d71c93a.zip)

Joe

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 22, 2014, 3:55pm UTC](https://forum.ansible.com/t/ansible-to-windows-indexerror-tuple-index-out-of-range/16008/5 "2014-08-22T15:55:28Z")

</div>

Any thoughts on this Chris?

---

<div class="post-metadata">

**Author:** ![Chris\_Church1](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@Chris\_Church1](https://forum.ansible.com/u/Chris_Church1)\
**Post date:** [August 25, 2014, 1:39am UTC](https://forum.ansible.com/t/ansible-to-windows-indexerror-tuple-index-out-of-range/16008/6 "2014-08-25T01:39:41Z")

</div>

The IndexError traceback was fixed by [https://github.com/ansible/ansible/commit/07f12539eee2faac5fe831cd31f1f0a5d3e7e661](https://github.com/ansible/ansible/commit/07f12539eee2faac5fe831cd31f1f0a5d3e7e661), and I just pushed a fix for running windows modules from playbooks ([https://github.com/ansible/ansible/commit/57dee4545b3c34d1e66943def8d5e45ee95d66bd](https://github.com/ansible/ansible/commit/57dee4545b3c34d1e66943def8d5e45ee95d66bd)).

The winrm integration tests are working for me now using ansible@devel and pywinrm@master.

---

<div class="post-metadata">

**Author:** ![Zhenkai\_Jiang](https://avatars.discourse-cdn.com/v4/letter/z/71c47a/32.png) [@Zhenkai\_Jiang](https://forum.ansible.com/u/Zhenkai_Jiang)\
**Post date:** [August 25, 2014, 2:27am UTC](https://forum.ansible.com/t/ansible-to-windows-indexerror-tuple-index-out-of-range/16008/7 "2014-08-25T02:27:08Z")

</div>

uninstalling pywinrm & installing old version do the trick. problem solved. Thanks.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 26, 2014, 12:30pm UTC](https://forum.ansible.com/t/ansible-to-windows-indexerror-tuple-index-out-of-range/16008/8 "2014-08-26T12:30:29Z")

</div>

Thanks Chris!
