# Ansible 1.9 dev 34ec877fe3 hangs on gather facts phase

**URL:** <https://forum.ansible.com/t/ansible-1-9-dev-34ec877fe3-hangs-on-gather-facts-phase/16918>\
**Category:** Ansible Project\
**Created:** [November 29, 2014, 4:49pm UTC](https://forum.ansible.com/t/ansible-1-9-dev-34ec877fe3-hangs-on-gather-facts-phase/16918 "2014-11-29T16:49:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giorgio\_Valoti](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@Giorgio\_Valoti](https://forum.ansible.com/u/Giorgio_Valoti)\
**Post date:** [November 29, 2014, 4:49pm UTC](https://forum.ansible.com/t/ansible-1-9-dev-34ec877fe3-hangs-on-gather-facts-phase/16918/1 "2014-11-29T16:49:57Z")

</div>

Hi all,

Ansible seems to hang on the gather facts phase.

Some details:

- The problem seems not related to password prompts and it was not  
hanging this way until now anyway.  
- The behavior seems 100% reproducible on LAN or localhost hosts but  
\*not\* on WAN ones.  
- LAN hosts are VMs running on SmartOS; WAN are basically the same, but  
running on bare metal or other virtualized environments.  
- I’m using the devel versione because I encountered the problem with  
ansible 1.7 and tried to solve it by updating it.

Here’s an excerpt of the verbose output:

\<dev-vm01.local\> ESTABLISH CONNECTION FOR USER: root  
\<dev-vm01.local\> REMOTE\_MODULE setup  
\<dev-vm01.local\> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/giorgio/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 dev-vm01.local /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1417279179.55-12830134400431 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1417279179.55-12830134400431 && echo $HOME/.ansible/tmp/ansible-tmp-1417279179.55-12830134400431'  
\<dev-vm01.local\> PUT /var/folders/yq/ydckqkv92jz4dhhlvd1ry5yr0000gn/T/tmpya9Vyg TO /root/.ansible/tmp/ansible-tmp-1417279179.55-12830134400431/setup  
\<dev-vm01.local\> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/giorgio/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 dev-vm01.local /bin/sh -c 'LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /opt/local/bin/python /root/.ansible/tmp/ansible-tmp-1417279179.55-12830134400431/setup; rm -rf /root/.ansible/tmp/ansible-tmp-1417279179.55-12830134400431/ \>/dev/null 2\>&1'

Any help would be really appreciated.

---

<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:** [November 29, 2014, 10:34pm UTC](https://forum.ansible.com/t/ansible-1-9-dev-34ec877fe3-hangs-on-gather-facts-phase/16918/2 "2014-11-29T22:34:37Z")

</div>

I think the easiest thing to do here would to do a checkout on the machine you are managing and then:

source ./hacking/env-setup  
./hacking/test-module -m setup

And see if that hangs. If that does, it’s most likely something in the setup module, rather than a connection issue - which I would say with a large degree of confidence is the case.

From there, we can help with some suggestions about how to figure out what part is taking so long to return – it might not be hanging but just taking a very long time, but we’ll see.

---

<div class="post-metadata">

**Author:** ![Giorgio\_Valoti](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@Giorgio\_Valoti](https://forum.ansible.com/u/Giorgio_Valoti)\
**Post date:** [November 30, 2014, 8:45am UTC](https://forum.ansible.com/t/ansible-1-9-dev-34ec877fe3-hangs-on-gather-facts-phase/16918/3 "2014-11-30T08:45:39Z")

</div>

Michael DeHaan \<michael@ansible.com\> writes:

> I think the easiest thing to do here would to do a checkout on the machine  
> you are managing and then:
> 
> source ./hacking/env-setup  
> ./hacking/test-module -m setup
> 
> And see if that hangs. If that does, it's most likely something in the  
> setup module, rather than a connection issue - which I would say with a  
> large degree of confidence is the case.
> 
> From there, we can help with some suggestions about how to figure out what  
> part is taking so long to return -- it might not be hanging but just taking  
> a very long time, but we'll see.

You’re right it does not hang.

I retried from my control machine and the gathering facts phase does  
complete after a very long time, a minute or so.

How can I collect additional info in order help you to track down the  
issue?

---

<div class="post-metadata">

**Author:** ![Giorgio\_Valoti](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@Giorgio\_Valoti](https://forum.ansible.com/u/Giorgio_Valoti)\
**Post date:** [December 1, 2014, 12:05pm UTC](https://forum.ansible.com/t/ansible-1-9-dev-34ec877fe3-hangs-on-gather-facts-phase/16918/4 "2014-12-01T12:05:54Z")

</div>

Giorgio Valoti \<giorgio\_v@me.com\> writes:

> Michael DeHaan \<michael@ansible.com\> writes:
> 
> > I think the easiest thing to do here would to do a checkout on the machine  
> > you are managing and then:
> > 
> > source ./hacking/env-setup  
> > ./hacking/test-module -m setup
> > 
> > And see if that hangs. If that does, it's most likely something in the  
> > setup module, rather than a connection issue - which I would say with a  
> > large degree of confidence is the case.
> > 
> > From there, we can help with some suggestions about how to figure out what  
> > part is taking so long to return -- it might not be hanging but just taking  
> > a very long time, but we'll see.
> 
> You’re right it does not hang.
> 
> I retried from my control machine and the gathering facts phase does  
> complete after a very long time, a minute or so.
> 
> How can I collect additional info in order help you to track down the  
> issue?

I’ve tried to gather facts with the setup module from my machine with a  
SmartOS zone and I get back the facts, but some are wrong and I am quite  
sure that this was \*not\* the case in the past.

Here are the most obvious errors:

> ansible vm-01.local -i hosts/dev -u root -m setup

vm-01.local | success \>\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"ansible\_facts": {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"ansible\_distribution": "NA",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"ansible\_distribution\_major\_version": "NA",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"ansible\_distribution\_release": "NA",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"ansible\_distribution\_version": "NA",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"ansible\_os\_family": "NA",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"ansible\_pkg\_mgr": "macports",  
&nbsp;&nbsp;&nbsp;&nbsp;},  
&nbsp;&nbsp;&nbsp;&nbsp;"changed": false  
}

---

<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:** [December 1, 2014, 2:50pm UTC](https://forum.ansible.com/t/ansible-1-9-dev-34ec877fe3-hangs-on-gather-facts-phase/16918/5 "2014-12-01T14:50:30Z")

</div>

Thanks for info – how long does this operation take?

Curious if you can debug to find individual methods, if not, that’s fine – maybe another SmartOS user could help.

---

<div class="post-metadata">

**Author:** ![Giorgio\_Valoti](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@Giorgio\_Valoti](https://forum.ansible.com/u/Giorgio_Valoti)\
**Post date:** [December 1, 2014, 7:22pm UTC](https://forum.ansible.com/t/ansible-1-9-dev-34ec877fe3-hangs-on-gather-facts-phase/16918/6 "2014-12-01T19:22:22Z")

</div>

Michael DeHaan \<michael@ansible.com\> writes:

> Thanks for info -- how long does this operation take?

A simple ssh command as a baseline:

> time ssh root@dev-vm01.local ls -a

Warning: Permanently added 'dev-vm01.local,192.168.38.147' (RSA) to the list of known hosts.  
.  
..  
.ansible  
.bash\_profile  
.bashrc  
.cshrc  
.irbrc  
.login  
.profile  
.ssh  
.vimrc  
ssh root@dev-vm01.local ls -a 0,01s user 0,00s system 0% cpu 1,235 total

And with ansible:

> time ansible dev-vm01.local -i hosts/localhost-dev -u root -m setup

\<lots of output...\>

ansible dev-vm01.local -i hosts/localhost-dev -u root -m setup 0,18s user 0,17s system 0% cpu 2:05,37 total

Hope this helps
