# Default SSH command timeout

**URL:** <https://forum.ansible.com/t/default-ssh-command-timeout/11489>\
**Category:** Ansible Project\
**Created:** [May 2, 2012, 11:13am UTC](https://forum.ansible.com/t/default-ssh-command-timeout/11489 "2012-05-02T11:13:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeroen\_Hoekx](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@Jeroen\_Hoekx](https://forum.ansible.com/u/Jeroen_Hoekx)\
**Post date:** [May 2, 2012, 11:13am UTC](https://forum.ansible.com/t/default-ssh-command-timeout/11489/1 "2012-05-02T11:13:21Z")

</div>

Hello,

Maybe it's a good idea to increase the command timeout for SSH  
connections. A first yum action can take quite some time since it's  
loading all the metadata. I hit the socket timeout of 10 seconds  
there:

fatal: [rh6oranode2] =\> Traceback (most recent call last):  
&nbsp;&nbsp;File "/home/jeroen/dev/ansible/work/lib/ansible/runner.py", line  
572, in \_executor  
&nbsp;&nbsp;&nbsp;&nbsp;(host, ok, data, err) = self.\_executor\_internal(host)  
&nbsp;&nbsp;File "/home/jeroen/dev/ansible/work/lib/ansible/runner.py", line  
611, in \_executor\_internal  
&nbsp;&nbsp;&nbsp;&nbsp;result = self.\_execute\_normal\_module(conn, host, tmp, module\_name)  
&nbsp;&nbsp;File "/home/jeroen/dev/ansible/work/lib/ansible/runner.py", line  
352, in \_execute\_normal\_module  
&nbsp;&nbsp;&nbsp;&nbsp;(result, err, executed) = self.\_execute\_module(conn, tmp, module,  
self.module\_args)  
&nbsp;&nbsp;File "/home/jeroen/dev/ansible/work/lib/ansible/runner.py", line  
299, in \_execute\_module  
&nbsp;&nbsp;&nbsp;&nbsp;res, err = self.\_exec\_command(conn, cmd, tmp, sudoable=True)  
&nbsp;&nbsp;File "/home/jeroen/dev/ansible/work/lib/ansible/runner.py", line  
644, in \_exec\_command  
&nbsp;&nbsp;&nbsp;&nbsp;err="\n".join(stderr.readlines())  
&nbsp;&nbsp;File "/home/jeroen/dev/ansible/lib/python2.7/site-packages/paramiko/file.py",  
line 259, in readlines  
&nbsp;&nbsp;&nbsp;&nbsp;line = self.readline()  
&nbsp;&nbsp;File "/home/jeroen/dev/ansible/lib/python2.7/site-packages/paramiko/file.py",  
line 214, in readline  
&nbsp;&nbsp;&nbsp;&nbsp;new\_data = self.\_read(n)  
&nbsp;&nbsp;File "/home/jeroen/dev/ansible/lib/python2.7/site-packages/paramiko/channel.py",  
line 1227, in \_read  
&nbsp;&nbsp;&nbsp;&nbsp;return self.channel.recv\_stderr(size)  
&nbsp;&nbsp;File "/home/jeroen/dev/ansible/lib/python2.7/site-packages/paramiko/channel.py",  
line 636, in recv\_stderr  
&nbsp;&nbsp;&nbsp;&nbsp;raise socket.timeout()  
timeout

Connection.py reuses the runner timeout as documented there:

> # reusing runner's TCP connect timeout as command progress timeout (correct?)

Runner timeout is 10 seconds. I believe we don't want to couple these  
values. Any suggestions as to what a correct value should be?

A workaround for now is running the task as async...

Greetings,

Jeroen

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [May 2, 2012, 11:21am UTC](https://forum.ansible.com/t/default-ssh-command-timeout/11489/2 "2012-05-02T11:21:01Z")

</div>

Maybe we should not reuse the runner SSH timeout value for sudo ops, because they mean quite different things?

I’d like to avoid an extra flag though.

A large enough value, perhaps?
