# Gathering facts just hung to infinity for my AWS hosts

**URL:** <https://forum.ansible.com/t/gathering-facts-just-hung-to-infinity-for-my-aws-hosts/16458>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [October 7, 2014, 6:55pm UTC](https://forum.ansible.com/t/gathering-facts-just-hung-to-infinity-for-my-aws-hosts/16458 "2014-10-07T18:55:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steven\_Truong](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Steven\_Truong](https://forum.ansible.com/u/Steven_Truong)\
**Post date:** [October 7, 2014, 6:55pm UTC](https://forum.ansible.com/t/gathering-facts-just-hung-to-infinity-for-my-aws-hosts/16458/1 "2014-10-07T18:55:12Z")

</div>

Hi,

I have a mixed or Amazon Linux and CentOS 6.5 on AWS but I just recently have had this problem. Running the “setup” scripts directly worked but Ansible gathering facts just hung.

# pwd

/home/adsymp/.ansible

# su root -c /bin/sh -c ‘echo SUDO-SUCCESS-dhyqcckwxzuthyzxqniggbjvfxvuewha; LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /usr/bin/python /home/adsymp/.ansible/tmp/ansible-tmp-1412705402.97-194667564226294/setup’

SUDO-SUCCESS-dhyqcckwxzuthyzxqniggbjvfxvuewha  
/home/adsymp/.ansible/tmp/ansible-tmp-1412705402.97-194667564226294/setup:2922: DeprecationWarning: object. **new** () takes no parameters  
return super(cls, subclass). **new** (subclass, \*arguments, \*\*keyword)  
{“verbose\_override”: true, “changed”: false, “ansible\_facts”: {“ansible\_product\_serial”: “”, “ansible\_form\_factor”: “”, “ansible\_product\_version”: “”, “ansible\_swaptotal\_mb”: 0, “ansible\_user\_id”: “root”, “module\_setup”: true, “ansible\_userspace\_bits”: “64”, “ansible\_distribution\_version”:

…

Ansible verbose …

EXEC [‘ssh’, ‘-C’, ‘-tt’, ‘-vvv’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/home/steven/.ansible/cp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘StrictHostKeyChecking=no’, ‘-o’, ‘IdentityFile=“/home/steven/.ssh/key-user”’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘User=user’, ‘-o’, ‘ConnectTimeout=10’, ‘ip-10-123…’, “/bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1412705402.97-194667564226294 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1412705402.97-194667564226294 && echo $HOME/.ansible/tmp/ansible-tmp-1412705402.97-194667564226294’”]  
 PUT /tmp/tmpLdghlG TO /home/user/.ansible/tmp/ansible-tmp-1412705402.97-194667564226294/setup  
 EXEC [‘ssh’, ‘-C’, ‘-tt’, ‘-vvv’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/home/steven/.ansible/cp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘StrictHostKeyChecking=no’, ‘-o’, ‘IdentityFile=“/home/steven/.ssh/key-user”’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘User=user’, ‘-o’, ‘ConnectTimeout=10’, ‘ip-10-123…’, u’/bin/sh -c 'su root -c “/bin/sh -c '”'“'echo SUDO-SUCCESS-dhyqcckwxzuthyzxqniggbjvfxvuewha; LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /usr/bin/python /home/adsymp/.ansible/tmp/ansible-tmp-1412705402.97-194667564226294/setup; rm -rf /home/adsymp/.ansible/tmp/ansible-tmp-1412705402.97-194667564226294/ \>/dev/null 2\>&1'”'“'”'']

Amazon Linux

#rpm -q openssh  
openssh-5.3p1-15.12.amzn1.x86\_64

# python --version

Python 2.6.5

CentOS:

$ rpm -q openssh  
openssh-6.4p1.el6-1.x86\_64  
$ python --version  
Python 2.6.6

I am using ansible 1.7.1.

Please help as this is really strange. I ran the setup with “python -m trace --trace” and nothing seems to stand out for causing the issue.

Thanks,  
Steven.

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [October 8, 2014, 1:44am UTC](https://forum.ansible.com/t/gathering-facts-just-hung-to-infinity-for-my-aws-hosts/16458/2 "2014-10-08T01:44:23Z")

</div>

Hi Steven,

Can you hop on one of the systems while the fact gathering is going on and see what may be hung that way? My bet is it could be something mount-related.

---

<div class="post-metadata">

**Author:** ![Steven\_Truong](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Steven\_Truong](https://forum.ansible.com/u/Steven_Truong)\
**Post date:** [October 8, 2014, 5:23pm UTC](https://forum.ansible.com/t/gathering-facts-just-hung-to-infinity-for-my-aws-hosts/16458/3 "2014-10-08T17:23:57Z")

</div>

Hi James,

Here are the mount points for my two typical systems affected by this issue.

bash-3.2$ df  
Filesystem 1K-blocks Used Available Use% Mounted on  
/dev/xvda1 10321208 4753692 5462660 47% /  
tmpfs 3825972 0 3825972 0% /dev/shm  
/dev/xvdc 433455904 3674680 407762920 1% /media/ephemeral0

Filesystem 1K-blocks Used Available Use% Mounted on  
/dev/xvde1 51606140 21435556 27549656 44% /  
tmpfs 7685444 0 7685444 0% /dev/shm  
/dev/xvdg 82558640 3882592 74482308 5% /media/ephemeral0  
/dev/xvdh 82558640 188292 78176608 1% /media/ephemeral1

When I logged in the systems and use strace to attach to the pid of the python process for ansible, I saw that it just hung there with

Process 406 attached - interrupt to quit  
read(0,

But I just simply ran the /usr/bin/python /home/adsymp/.ansible/tmp/ansible-tmp-1412788904.43-83621415975693/setup then I got the complete expected facts.

Thank you,  
Steven.

---

<div class="post-metadata">

**Author:** ![Steven\_Truong](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Steven\_Truong](https://forum.ansible.com/u/Steven_Truong)\
**Post date:** [October 10, 2014, 7:44pm UTC](https://forum.ansible.com/t/gathering-facts-just-hung-to-infinity-for-my-aws-hosts/16458/4 "2014-10-10T19:44:47Z")

</div>

Hi all,

I worked around and tried not to use any facts so I disabled fact gathering in my playbook. I now ran into a strange problem and even for a simplest task such as running a shell command the whole thing would just hung…

\< TASK: bash | cp /usr/local/bin/help to /usr/local/bin/help.old \>

---

<div class="post-metadata">

**Author:** ![Steven\_Truong](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Steven\_Truong](https://forum.ansible.com/u/Steven_Truong)\
**Post date:** [October 10, 2014, 10:48pm UTC](https://forum.ansible.com/t/gathering-facts-just-hung-to-infinity-for-my-aws-hosts/16458/5 "2014-10-10T22:48:20Z")

</div>

Well, you do not have to guess. I feel very stupid and spent times looking into this.

Apparently I used the wrong options for ansible-playbook…

ansible-playbook base.yml --tags useful -i hosts.awse --limit awse-c --private-key ~/.ssh/key-user -u user -s

This works.

Sorry to all…  
Steven.
