# Error AnsiballZ\_setup.py line 27

**URL:** <https://forum.ansible.com/t/error-ansiballz-setup-py-line-27/35939>\
**Category:** Ansible Project\
**Created:** [October 29, 2021, 10:33am UTC](https://forum.ansible.com/t/error-ansiballz-setup-py-line-27/35939 "2021-10-29T10:33:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jagannath\_Pattar](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@Jagannath\_Pattar](https://forum.ansible.com/u/Jagannath_Pattar)\
**Post date:** [October 29, 2021, 10:33am UTC](https://forum.ansible.com/t/error-ansiballz-setup-py-line-27/35939/1 "2021-10-29T10:33:04Z")

</div>

Hi,  
I am getting following error even though I have python 2.7.18 in my host system.Can someone help me to resolve the issue?

LAY [label\_ansible\_yes] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

PLAY [label\_ansible\_role\_trafgen] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Friday 29 October 2021 12:22:28 +0200 (0:00:00.151) 0:00:00.151 \*\*\*\*\*\*\*\*  
fatal: [enl-trafgen-0\_enl-trafgen]: FAILED! =\> {“ansible\_facts”: {}, “changed”: false, “failed\_modules”: {“setup”: {“ansible\_facts”: {“discovered\_interpreter\_python”: “/usr/bin/python”}, “failed”: true, “module\_stderr”: " File "/tmp/ansible-tmp-1635502948.8-187514138802855/AnsiballZ\_setup.py", line 27\n ZIPDATA = """UEsDBBQAAAAIAM5iXVOdxfFrNwAAAEgAAAAgAAAAYW5zaWJsZS9tb2R1bGVfdXRpbHMvX19pbml0X18ucHlLK8rPVSjITi8tycxRyMwtyC8qUUitKEnNS4kvSCzJ4IoHU/  
…  
…  
+Y1tf3nHdUDq50GQuBVB5B6LdHUrZ9AlWHPhMpaHjGW3iX5quUucM6RDgPeea6aL3srz1fzozdmgq23uFs4pI7tafRrHPMVPN3Lgisuwid84aeV4eonwrTaCuszPeyaJCfmcIoeGgNhggqZ4VF8JL3JYDhqQzAp6aF3ThKgee7wFgB2ahMnblafSrUqOX19qlG\n ^\nSyntaxError: EOF while scanning triple-quoted string literal\ncommand terminated with exit code 1\n", “module\_stdout”: “”, “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”, “rc”: 1, “warnings”: [“Platform linux on host enl-trafgen-0\_enl-trafgen is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See [https://docs.ansible.com/ansible/2.9/reference\_appendices/interpreter\_discovery.html](https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html) for more information.”]}}, “msg”: “The following modules failed to execute: setup\n”}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
enl-trafgen-0\_enl-trafgen : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

Friday 29 October 2021 12:22:31 +0200 (0:00:02.637) 0:00:02.789 \*\*\*\*\*\*\*\*

---

<div class="post-metadata">

**Author:** ![Jagannath\_Pattar](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@Jagannath\_Pattar](https://forum.ansible.com/u/Jagannath_Pattar)\
**Post date:** [November 3, 2021, 11:49am UTC](https://forum.ansible.com/t/error-ansiballz-setup-py-line-27/35939/2 "2021-11-03T11:49:15Z")

</div>

Can some one help me resolve this issue? I tired with having similar python 2.7.18 on host, target vm and pod. but still the problem persists.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 3, 2021, 2:27pm UTC](https://forum.ansible.com/t/error-ansiballz-setup-py-line-27/35939/3 "2021-11-03T14:27:38Z")

</div>

use -vvv and make sure the 'setup' being picked up for execution is  
the Ansible one, this seems like an issue of having another setup.py  
in your PYTHONPATH that is obscuring the Ansible one.

---

<div class="post-metadata">

**Author:** ![Jagannath\_Pattar](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@Jagannath\_Pattar](https://forum.ansible.com/u/Jagannath_Pattar)\
**Post date:** [November 4, 2021, 11:24am UTC](https://forum.ansible.com/t/error-ansiballz-setup-py-line-27/35939/4 "2021-11-04T11:24:03Z")

</div>

Hi Brian,

Thanks for the hint. With -vvvvv option I found that the file copy AnsiballZ\_setup.py from host to target pod got corrupted.  
It copied half of the file where the the file has triple quotes.

I see that ansible uses PUT (curl?) to copy the files to target pods:  
\<enl-trafgen-0\_enl-trafgen\> PUT /home/ejagpat/.ansible/tmp/ansible-local-5870YgWwiY/tmpeayo3R TO /tmp/ansible-tmp-1636022875.82-192503508326341/AnsiballZ\_setup.py

Is there alternative to this method? what is the problem then?

Thanks for help,  
Jagannath

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 4, 2021, 6:25pm UTC](https://forum.ansible.com/t/error-ansiballz-setup-py-line-27/35939/5 "2021-11-04T18:25:55Z")

</div>

the method used depends on the connection plugin you are using and  
that should be visible in the -vvv output, PUT is just 'the action  
done' not really that it is using an http method (winrm does, but most  
others do not). Afaik there are no plugins that use curl. If using  
ssh, you can configure the method sftp, scp or dd over the ssh pipe.

---

<div class="post-metadata">

**Author:** ![Jagannath\_Pattar](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@Jagannath\_Pattar](https://forum.ansible.com/u/Jagannath_Pattar)\
**Post date:** [November 5, 2021, 1:58pm UTC](https://forum.ansible.com/t/error-ansiballz-setup-py-line-27/35939/6 "2021-11-05T13:58:13Z")

</div>

Hi Brian,

I found that ansible do not use SSH to communicate with k8s PODS. Hence those option sftp/scp/dd are not valid.  
The AnsiballZ\_setup.py file is constructed by ansible and sent to pod using kubectl api-server APIs.  
So, this file is copied half.

I am running out of ideas to debug it further ☹

Thanks,  
Jagannath

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 5, 2021, 2:01pm UTC](https://forum.ansible.com/t/error-ansiballz-setup-py-line-27/35939/7 "2021-11-05T14:01:34Z")

</div>

Open a bug report on the connection plugin you are using.

---

<div class="post-metadata">

**Author:** ![Jagannath\_Pattar](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@Jagannath\_Pattar](https://forum.ansible.com/u/Jagannath_Pattar)\
**Post date:** [November 17, 2021, 10:16am UTC](https://forum.ansible.com/t/error-ansiballz-setup-py-line-27/35939/8 "2021-11-17T10:16:46Z")

</div>

Hi Brian,

Well till no many experiments failed from my side.  
Where I should raise a bug? Could you please provide the link?

Thanks,  
Jagannath
