# ansible debug troubleshooting - script failing

**URL:** <https://forum.ansible.com/t/ansible-debug-troubleshooting-script-failing/33354>\
**Category:** Ansible Project\
**Created:** [July 9, 2020, 1:09am UTC](https://forum.ansible.com/t/ansible-debug-troubleshooting-script-failing/33354 "2020-07-09T01:09:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stack\_flow](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@stack\_flow](https://forum.ansible.com/u/stack_flow)\
**Post date:** [July 9, 2020, 1:09am UTC](https://forum.ansible.com/t/ansible-debug-troubleshooting-script-failing/33354/1 "2020-07-09T01:09:33Z")

</div>

Hello, I am new to ansible and its troubleshooting. my ansible script is failing. below is output. could you advise why is the script failing?

_\<10.10.100.59\> attempting to start connection_  
_\<10.10.100.59\> using connection plugin network\_cli_  
_\<10.10.100.31\> attempting to start connection_  
_\<10.10.100.31\> using connection plugin network\_cli_  
_\<10.10.100.59\> local domain socket does not exist, starting it_  
_\<10.10.100.59\> control socket path is /Users/ljamm/.ansible/pc/f58522fe09_  
_\<10.10.100.59\> local domain socket listeners started successfully_  
_\<10.10.100.31\> local domain socket does not exist, starting it_  
_\<10.10.100.59\> loaded cliconf plugin ios from path /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/plugins/cliconf/ios.py for network\_os ios_  
_\<10.10.100.31\> control socket path is /Users/ljamm/.ansible/pc/91c938f5a6_  
_\<10.10.100.59\>_  
_\<10.10.100.31\> local domain socket listeners started successfully_  
_\<10.10.100.59\> local domain socket path is /Users/ljamm/.ansible/pc/f58522fe09_  
_\<10.10.100.31\> loaded cliconf plugin ios from path /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/plugins/cliconf/ios.py for network\_os ios_  
_\<10.10.100.31\>_  
_\<10.10.100.31\> local domain socket path is /Users/ljamm/.ansible/pc/91c938f5a6_  
_[WARNING]: Ignoring timeout(10) for ios\_facts_  
_[WARNING]: Ignoring timeout(10) for ios\_facts_  
 _Attempting python interpreter discovery_  
 _Attempting python interpreter discovery_  
_\<10.10.100.59\> ESTABLISH LOCAL CONNECTION FOR USER: ljamm_  
_\<10.10.100.59\> EXEC /bin/sh -c ‘echo PLATFORM; uname; echo FOUND; command -v ‘"’"’/usr/bin/python’“'”‘; command -v ‘"’“‘python3.7’”’“'; command -v '”‘“‘python3.6’”’“'; command -v '”‘“‘python3.5’”’“'; command -v '”‘“‘python2.7’”’“'; command -v '”‘“‘python2.6’”’“'; command -v '”‘"’/usr/libexec/platform-python’“'”‘; command -v ‘"’"’/usr/bin/python3’“'”‘; command -v ‘"’“‘python’”’"‘; echo ENDFOUND && sleep 0’_  
_\<10.10.100.31\> ESTABLISH LOCAL CONNECTION FOR USER: ljamm_  
_\<10.10.100.31\> EXEC /bin/sh -c ‘echo PLATFORM; uname; echo FOUND; command -v ‘"’"’/usr/bin/python’“'”‘; command -v ‘"’“‘python3.7’”’“'; command -v '”‘“‘python3.6’”’“'; command -v '”‘“‘python3.5’”’“'; command -v '”‘“‘python2.7’”’“'; command -v '”‘“‘python2.6’”’“'; command -v '”‘"’/usr/libexec/platform-python’“'”‘; command -v ‘"’"’/usr/bin/python3’“'”‘; command -v ‘"’“‘python’”’"‘; echo ENDFOUND && sleep 0’_  
 _Python interpreter discovery fallback (unsupported platform for extended discovery: darwin)_  
_Using module file /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/modules/network/ios/ios\_facts.py_  
 _Python interpreter discovery fallback (unsupported platform for extended discovery: darwin)_  
_Pipelining is enabled._  
_\<10.10.100.59\> EXEC /bin/sh -c ‘/usr/bin/python && sleep 0’_  
_Using module file /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/modules/network/ios/ios\_facts.py_  
_Pipelining is enabled._  
_\<10.10.100.31\> EXEC /bin/sh -c ‘/usr/bin/python && sleep 0’_  
_fatal: [iosv-1]: FAILED! =\> {_  
_“ansible\_facts”: {},_  
_“changed”: false,_  
_“failed\_modules”: {_  
_“ios\_facts”: {_  
_“ansible\_facts”: {_  
_“discovered\_interpreter\_python”: “/usr/bin/python”_  
_},_  
_“exception”: “WARNING: The below traceback may not be related to the actual failure.\n File "/var/folders/l8/gjnzx82j2fbd8dqjdxvmx7940000gn/T/ansible\_ios\_facts\_payload\_rig\_Ih/ansible\_ios\_facts\_payload.zip/ansible/module\_utils/network/common/network.py", line 229, in get\_capabilities\n capabilities = Connection(module.\_socket\_path).get\_capabilities()\n File "/var/folders/l8/gjnzx82j2fbd8dqjdxvmx7940000gn/T/ansible\_ios\_facts\_payload\_rig\_Ih/ansible\_ios\_facts\_payload.zip/ansible/module\_utils/connection.py", line 185, in **rpc** \n raise ConnectionError(to\_text(msg, errors=‘surrogate\_then\_replace’), code=code)\n”,_  
_“failed”: true,_  
_“invocation”: {_  
_“module\_args”: {_  
_“auth\_pass”: null,_  
_“authorize”: null,_  
_“gather\_network\_resources”: null,_  
_“gather\_subset”: [_  
_“all”_  
_],_  
_“host”: null,_  
_“password”: null,_  
_“port”: null,_  
_“provider”: null,_  
_“ssh\_keyfile”: null,_  
_“timeout”: null,_  
_“username”: null_  
_}_  
_},_  
_“msg”: “[Errno None] Unable to connect to port 22 on 10.10.100.59”,_  
_“warnings”: [_  
_“Platform darwin on host iosv-1 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 for more information.”_  
_]_  
_}_  
_},_  
_“msg”: “The following modules failed to execute: ios\_facts\n”_  
_}_  
_fatal: [iosv-2]: FAILED! =\> {_  
_“ansible\_facts”: {},_  
_“changed”: false,_  
_“failed\_modules”: {_  
_“ios\_facts”: {_  
_“ansible\_facts”: {_  
_“discovered\_interpreter\_python”: “/usr/bin/python”_  
_},_  
_“exception”: “WARNING: The below traceback may not be related to the actual failure.\n File "/var/folders/l8/gjnzx82j2fbd8dqjdxvmx7940000gn/T/ansible\_ios\_facts\_payload\_ngRqZd/ansible\_ios\_facts\_payload.zip/ansible/module\_utils/network/common/network.py", line 229, in get\_capabilities\n capabilities = Connection(module.\_socket\_path).get\_capabilities()\n File "/var/folders/l8/gjnzx82j2fbd8dqjdxvmx7940000gn/T/ansible\_ios\_facts\_payload\_ngRqZd/ansible\_ios\_facts\_payload.zip/ansible/module\_utils/connection.py", line 185, in **rpc** \n raise ConnectionError(to\_text(msg, errors=‘surrogate\_then\_replace’), code=code)\n”,_  
_“failed”: true,_  
_“invocation”: {_  
_“module\_args”: {_  
_“auth\_pass”: null,_  
_“authorize”: null,_  
_“gather\_network\_resources”: null,_  
_“gather\_subset”: [_  
_“all”_  
_],_  
_“host”: null,_  
_“password”: null,_  
_“port”: null,_  
_“provider”: null,_  
_“ssh\_keyfile”: null,_  
_“timeout”: null,_  
_“username”: null_  
_}_  
_},_  
_“msg”: “[Errno None] Unable to connect to port 22 on 10.10.100.31”,_  
_“warnings”: [_  
_“Platform darwin on host iosv-2 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 for more information.”_  
_]_  
_}_  
_},_  
_“msg”: “The following modules failed to execute: ios\_facts\n”_  
_}_

_PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_  
_iosv-1 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0_  
_iosv-2 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0_

_Wednesday 08 July 2020 21:01:31 -0400 (0:00:15.930) 0:00:16.016 \*\*\*\*\*\*\*\*_

---

<div class="post-metadata">

**Author:** ![stack\_flow](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@stack\_flow](https://forum.ansible.com/u/stack_flow)\
**Post date:** [July 9, 2020, 1:14am UTC](https://forum.ansible.com/t/ansible-debug-troubleshooting-script-failing/33354/2 "2020-07-09T01:14:09Z")

</div>

I also keep on getting following msgs:

TASK [show hostname] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Wednesday 08 July 2020 21:12:10 -0400 (0:00:00.090) 0:00:00.090 \*\*\*\*\*\*\*\*  
_[WARNING]: Platform darwin on host iosv-2 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._  
_fatal: [iosv-2]: FAILED! =\> {“ansible\_facts”: {“discovered\_interpreter\_python”: “/usr/bin/python”}, “changed”: false, “msg”: “[Errno None] Unable to connect to port 22 on 10.10.100.31”}_

---

<div class="post-metadata">

**Author:** ![Ameya\_Agashe](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@Ameya\_Agashe](https://forum.ansible.com/u/Ameya_Agashe)\
**Post date:** [July 9, 2020, 2:24am UTC](https://forum.ansible.com/t/ansible-debug-troubleshooting-script-failing/33354/3 "2020-07-09T02:24:29Z")

</div>

This is a network related issue, and not related to ansible:

_ **Unable to connect to port 22 on 10.10.100.31"** _

From Ansible controller try to ping or do telnet on the above machine on port 22 and past the output here.

Example:  
telnet 10.10.100.31 22

You are not able to reach that machine, that is causing the grief.

Regards,  
Ameya

---

<div class="post-metadata">

**Author:** ![stack\_flow](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@stack\_flow](https://forum.ansible.com/u/stack_flow)\
**Post date:** [July 9, 2020, 3:05am UTC](https://forum.ansible.com/t/ansible-debug-troubleshooting-script-failing/33354/4 "2020-07-09T03:05:52Z")

</div>

Thx. I was able to ssh from command line so this isn’t network issue. is it because of python?

TASK [show hostname] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Wednesday 08 July 2020 21:12:10 -0400 (0:00:00.090) 0:00:00.090 \*\*\*\*\*\*\*\*  
_[WARNING]: Platform darwin on host iosv-2 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._  
_fatal: [iosv-2]: FAILED! =\> {“ansible\_facts”: {“discovered\_interpreter\_python”: “/usr/bin/python”}, “changed”: false, “msg”: “[Errno None] Unable to connect to port 22 on 10.10.100.31”}_

is it because of python? see below.

_ljamm@ljamm 2\_templates\_conditionals % ansible --version_  
_ansible 2.9.10_  
_config file = /etc/ansible/ansible.cfg_  
_configured module search path = [‘/Users/ljamm/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]_  
_ansible python module location = /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible_  
_executable location = /Library/Frameworks/Python.framework/Versions/3.7/bin/ansible_  
_python version = 3.7.7 (v3.7.7:d7c567b08f, Mar 10 2020, 02:56:16) [Clang 6.0 (clang-600.0.57)]_  
_ljamm@ljamm 2\_templates\_conditionals %_  
_ljamm@ljamm 2\_templates\_conditionals % python --version_  
_Python 2.7.16_  
_ljamm@ljamm 2\_templates\_conditionals %_

---

<div class="post-metadata">

**Author:** ![Srinivas\_Naram](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@Srinivas\_Naram](https://forum.ansible.com/u/Srinivas_Naram)\
**Post date:** [July 9, 2020, 5:59am UTC](https://forum.ansible.com/t/ansible-debug-troubleshooting-script-failing/33354/5 "2020-07-09T05:59:58Z")

</div>

[https://docs.ansible.com/ansible/latest/user\_guide/connection\_details.html](https://docs.ansible.com/ansible/latest/user_guide/connection_details.html)
