ssh connection is broken while running task.

1,120 views
Skip to first unread message

selvam vasu

unread,
Apr 13, 2016, 1:57:10 AM4/13/16
to Ansible Project
Hi,
I have playbook which has 4 tasks on that. The task are running on more than 10 remote hosts. The first two tasks are ever running without any problem. But when the third task is running, The am getting error like "SSH Error: mux_client_hello_exchange: write packet: Broken pipe". It is not happening always. It is happening at some times only and also it not happened for specific host. The issue is happening randomly on hosts list. 

Ansible logs;
****************

TASK: [create symbolic link to latest logstash package] ***********************
<host1> REMOTE_MODULE file path=/opt/installs/logstash/logstash-sdf_current src=/opt/installs/logstash/logstash-2.2.3 state=link force=yes
<host1> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/sdf/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 host1 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1460458867.58-123380470331659 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1460458867.58-123380470331659 && echo $HOME/.ansible/tmp/ansible-tmp-1460458867.58-123380470331659'
fatal: [host1] => SSH Error: mux_client_hello_exchange: write packet: Broken pipe
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.

I have googled solution for the issue. But I can't find it nowhere. Is there any option to retry ssh connection to run the task again when ssh connection is broken. 
If any one have idea about this issue, please shed some lights for this issue.

Toshaan Bharvani | VanTosh

unread,
Apr 18, 2016, 8:29:06 AM4/18/16
to ansible...@googlegroups.com
mux_client normally has to do with your ssh socket settings on your
ansible mgmt host (local machine), they are controlled by the Control*
options.
Check your local machine ssh config, increase ControlPersist, personally
I think 60s is quite useless, you might be better off disabling
ControlMaster, if you are not going to keep the socket up for the
duration of you playbook.
However check that the ControlPath folder exists
"/home/sdf/.ansible/cp/" with the right permissions.

If the error persists, try the setup/ping module with full verbose
" bin/ansible host1 -m setup -vvvv "


>
> I have googled solution for the issue. But I can't find it nowhere. Is
> there any option to retry ssh connection to run the task again when ssh
> connection is broken.
> If any one have idea about this issue, please shed some lights for this
> issue.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ansible-proje...@googlegroups.com
> <mailto:ansible-proje...@googlegroups.com>.
> To post to this group, send email to ansible...@googlegroups.com
> <mailto:ansible...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/42e9c60b-9e03-48ef-9b1f-6494a459e4c8%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/42e9c60b-9e03-48ef-9b1f-6494a459e4c8%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages