# Couldn't read packet: Connection reset by peer

**URL:** <https://forum.ansible.com/t/couldnt-read-packet-connection-reset-by-peer/18861>\
**Category:** Ansible Project\
**Created:** [July 27, 2015, 11:08am UTC](https://forum.ansible.com/t/couldnt-read-packet-connection-reset-by-peer/18861 "2015-07-27T11:08:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barry\_Kaplan](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@Barry\_Kaplan](https://forum.ansible.com/u/Barry_Kaplan)\
**Post date:** [July 27, 2015, 11:08am UTC](https://forum.ansible.com/t/couldnt-read-packet-connection-reset-by-peer/18861/1 "2015-07-27T11:08:10Z")

</div>

I am now getting these errors with a playbook that has been working for ages. I just recreated the ec2 instances – so that is what is different – but they were created using an existing ansible playbook.

I can ssh into the instances. I have added ‘scp\_if\_ssh=True’ (base on other posts with the problem).

Below is the full output. I ran with ANSIBLE\_KEEP\_REMOTE\_FILES=true but none of the files named below exists on either the control or target nodes.

What could be causing this?

`  
TASK: [Get target plant agent data from consul] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
\<10.0.17.36\> ESTABLISH CONNECTION FOR USER: bkaplan  
\<10.0.16.95\> ESTABLISH CONNECTION FOR USER: bkaplan  
\<10.0.17.36\> REMOTE\_MODULE consul\_kv key=connect/agents/ dc=production separator=/ action=get  
\<10.0.16.95\> REMOTE\_MODULE consul\_kv key=connect/agents/ dc=production separator=/ action=get  
\<10.0.17.36\> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=30m -o ControlPath=“/home/bkaplan/.ansible/cp/ansible-ssh-%h-%p-%r” -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 10.0.17.36 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1437995130.55-158041250609762 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1437995130.55-158041250609762 && echo $HOME/.ansible/tmp/ansible-tmp-1437995130.55-158041250609762’  
\<10.0.16.95\> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=30m -o ControlPath=“/home/bkaplan/.ansible/cp/ansible-ssh-%h-%p-%r” -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 10.0.16.95 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1437995130.56-253943851193697 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1437995130.56-253943851193697 && echo $HOME/.ansible/tmp/ansible-tmp-1437995130.56-253943851193697’  
\<10.0.17.36\> PUT /tmp/tmpSRuXAO TO /home/barry/.ansible/tmp/ansible-tmp-1437995130.55-158041250609762/consul\_kv  
\<10.0.16.95\> PUT /tmp/tmpPMQztN TO /home/barry/.ansible/tmp/ansible-tmp-1437995130.56-253943851193697/consul\_kv  
fatal: [10.0.17.36] =\> failed to transfer file to /home/barry/.ansible/tmp/ansible-tmp-1437995130.55-158041250609762/consul\_kv:

Couldn’t read packet: Connection reset by peer

fatal: [10.0.16.95] =\> failed to transfer file to /home/barry/.ansible/tmp/ansible-tmp-1437995130.56-253943851193697/consul\_kv:

Couldn’t read packet: Connection reset by peer

FATAL: all hosts have already failed – aborting

`
