# Gather facts failed to execute on target(Redhat)

**URL:** <https://forum.ansible.com/t/gather-facts-failed-to-execute-on-target-redhat/38233>\
**Category:** Ansible Developer\
**Created:** [July 17, 2023, 10:29am UTC](https://forum.ansible.com/t/gather-facts-failed-to-execute-on-target-redhat/38233 "2023-07-17T10:29:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [July 17, 2023, 10:29am UTC](https://forum.ansible.com/t/gather-facts-failed-to-execute-on-target-redhat/38233/1 "2023-07-17T10:29:28Z")

</div>

Hi Team,

One of the server encountered the below issue while executing setup module, Can anyone help ?

OS: redhat-release-5Server-5.11.0.9

Error message:

_“ansible\_facts”: {_  
_“discovered\_interpreter\_python”: “/usr/bin/python”_  
_},_  
_“changed”: false,_  
_“module\_stderr”: “OpenSSH\_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 58: Applying options for \*\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug2: mux\_client\_hello\_exchange: master version 4\r\ndebug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux\_client\_request\_session: entering\r\ndebug3: mux\_client\_request\_alive: entering\r\ndebug3: mux\_client\_request\_alive: done pid = 17281\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\nShared connection to [test1.lab.net](http://test1.lab.net) closed.\r\n”,_  
_“module\_stdout”: " File "/var/lib/ansible/.ansible/tmp/ansible-tmp-1689584397.189888-17274-87468472332769/AnsiballZ\_setup.py", line 72\r\n with open(args\_path, ‘rb’) as f:\r\n ^\r\nSyntaxError: invalid syntax\r\n",_  
_“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,_

Thanks

---

<div class="post-metadata">

**Author:** ![Andreas\_Harpfer](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Andreas\_Harpfer](https://forum.ansible.com/u/Andreas_Harpfer)\
**Post date:** [July 17, 2023, 1:15pm UTC](https://forum.ansible.com/t/gather-facts-failed-to-execute-on-target-redhat/38233/2 "2023-07-17T13:15:46Z")

</div>

\*Cough\* … RHEL 5 … seriously!? That's prehistoric and even extended life  
cycle support for this release has ended in Nov 2020!

Regarding the technical reason for your error: AFAIK RHEL 5 comes with  
Python 2.4; Ansible requires at least Python 2.6 on a managed node; see

[https://docs.ansible.com/ansible/latest/installation\_guide/intro\_installation.html#managed-node-requirements](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#managed-node-requirements)

for details.

Cheers  
-Andi

---

<div class="post-metadata">

**Author:** ![Andreas\_Harpfer](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Andreas\_Harpfer](https://forum.ansible.com/u/Andreas_Harpfer)\
**Post date:** [July 17, 2023, 1:26pm UTC](https://forum.ansible.com/t/gather-facts-failed-to-execute-on-target-redhat/38233/3 "2023-07-17T13:26:15Z")

</div>

> Regarding the technical reason for your error: AFAIK RHEL 5 comes with  
> Python 2.4; Ansible requires at least Python 2.6 on a managed node; see

Minor correction … the above was the requirement for Ansible 2.9, the  
latest Ansible version even requires Python 2.7.

---

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [July 18, 2023, 6:18am UTC](https://forum.ansible.com/t/gather-facts-failed-to-execute-on-target-redhat/38233/4 "2023-07-18T06:18:59Z")

</div>

Thank you Andi !!!
