# ansible stuck when gathering fatcs.

**URL:** <https://forum.ansible.com/t/ansible-stuck-when-gathering-fatcs/18392>\
**Category:** Ansible Project\
**Created:** [June 3, 2015, 9:04am UTC](https://forum.ansible.com/t/ansible-stuck-when-gathering-fatcs/18392 "2015-06-03T09:04:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuyuntao](https://avatars.discourse-cdn.com/v4/letter/y/b9e5f3/32.png) [@yuyuntao](https://forum.ansible.com/u/yuyuntao)\
**Post date:** [June 3, 2015, 9:04am UTC](https://forum.ansible.com/t/ansible-stuck-when-gathering-fatcs/18392/1 "2015-06-03T09:04:08Z")

</div>

I resolved this problem by add timeout in runner/connection\_plugins/ssh.py, such as:

157 import time  
158 start = time.time()  
159 TIMEOUT = self.runner.timeout\*2  
160 while True:  
161 rfd, wfd, efd = select.select(rpipes, , rpipes, 1)  
162  
163 # fail early if the sudo/su password is wrong  
164 if self.runner.sudo and sudoable:  
165 if self.runner.sudo\_pass:  
166 incorrect\_password = gettext.dgettext(  
167 “sudo”, “Sorry, try again.”)  
168 if stdout.endswith(“%s\r\n%s” % (incorrect\_password,  
169 prompt)):  
170 raise errors.AnsibleError(‘Incorrect sudo password’)  
171  
172 if stdout.endswith(prompt):  
173 raise errors.AnsibleError(‘Missing sudo password’)  
174  
175 if self.runner.su and su and self.runner.su\_pass:  
176 incorrect\_password = gettext.dgettext(  
177 “su”, “Sorry”)  
178 if stdout.endswith(“%s\r\n%s” % (incorrect\_password, prompt)):  
179 raise errors.AnsibleError(‘Incorrect su password’)  
180  
181 end = time.time()  
182 if TIMEOUT \<= (end - start):  
183 raise errors.AnsibleError(‘Read ssh stdin timeout’)

Is there any way to resolve that?

Thank you.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 3, 2015, 5:01pm UTC](https://forum.ansible.com/t/ansible-stuck-when-gathering-fatcs/18392/2 "2015-06-03T17:01:28Z")

</div>

facts themselves have a timeout around them, but it is on the target  
side, IIRC we also have a connection timeout but that might be a bit  
longer.

In any case, try with latest devel, there have been many changes to  
the connections and this might have been 'fixed'.

---

<div class="post-metadata">

**Author:** ![yuyuntao](https://avatars.discourse-cdn.com/v4/letter/y/b9e5f3/32.png) [@yuyuntao](https://forum.ansible.com/u/yuyuntao)\
**Post date:** [June 4, 2015, 7:56am UTC](https://forum.ansible.com/t/ansible-stuck-when-gathering-fatcs/18392/3 "2015-06-04T07:56:53Z")

</div>

Ok, thank you.
