When running a playbook, I get "Couldn't read packet: Connection reset by peer" error.

712 views
Skip to first unread message

David Reagan

unread,
Sep 12, 2014, 2:42:07 PM9/12/14
to ansible...@googlegroups.com
When running a playbook, I get "Couldn't read packet: Connection reset by peer" error.

For playbook, command, and -vvvv output see: http://pastebin.com/VgAuvrct

Ansible works fine on host1, but I get the error on host2.

If I just use ssh on the command line, both hosts work fine.

I've triple checked firewall, ssh_config, sshd_config, /tmp permissions, the users authorized_keys file perms, .ssh dir perms, ssh version, and even the network configuration. Both servers are configured exactly the same.

The remote hosts are running OES11 SP1.

My local desktop is Ubuntu 14.04.

I just pulled the devel branch of Ansible this morning.

Suggestions?

Michael DeHaan

unread,
Sep 12, 2014, 3:22:00 PM9/12/14
to ansible...@googlegroups.com
Can you show /tmp permissions?

Also make sure you are SSH'ing as root and not a different user when doing the SSH check?









--
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.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/05e45af7-4118-4985-b79c-98110d3f6bfa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Reagan

unread,
Sep 12, 2014, 3:59:21 PM9/12/14
to ansible...@googlegroups.com
/tmp on host1
> drwxrwxrwt  45 root root  4096 Sep 12 11:26 tmp

/tmp on host2
> drwxrwxrwt  47 root root    12288 Sep 12 12:55 tmp

root is blocked from ssh.

--David Reagan

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/YxBp49NtphM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.

To post to this group, send email to ansible...@googlegroups.com.

Michael DeHaan

unread,
Sep 12, 2014, 4:06:24 PM9/12/14
to ansible...@googlegroups.com
What about permissions on the ansible-tmp directory mentioned above?

You may need to set ANSIBLE_KEEP_REMOTE_FILES=1 in your environment to keep it around.



David Reagan

unread,
Sep 12, 2014, 4:29:33 PM9/12/14
to ansible...@googlegroups.com
On host1 (where it works)
drwxr-xr-x 2 remoteuser users       4096 Sep 12 13:21 ansible-tmp-1410553290.83-203438518100770

tmp/ansible-tmp-1410553290.83-203438518100770:
total 164
-rw------- 1 remoteuser users 163033 Sep 12 13:21 setup

On host2 (where it doesn't work)
drwxr-xr-x 2 remoteuser users       4096 Sep 12 11:26 ansible-tmp-1410546380.19-138456709998536

# ll tmp/ansible-tmp-1410546380.19-138456709998536
total 0

Like I saw before, the perms are the same.

I initially thought it could be a misconfigured sftp configuration line in the sshd_config. But the two configs are identical.

Hmm... I did check sudo config in the UI, but I haven't tried visudo yet. Maybe that'll show something...

Michael DeHaan

unread,
Sep 12, 2014, 4:35:08 PM9/12/14
to ansible...@googlegroups.com
If using the SSH connection (which you are by default) you could consider toggling SFTP/SCP in ansible.cfg and see if that helps.

One more thing to try...

But yeah you say those are the same so that's weird.



David Reagan

unread,
Sep 12, 2014, 4:46:12 PM9/12/14
to ansible...@googlegroups.com
scp_if_ssh=True made it work. Weird, very weird.

Is there any major difference between using sftp vs scp? 

--David Reagan

Michael DeHaan

unread,
Sep 12, 2014, 4:48:02 PM9/12/14
to ansible...@googlegroups.com
Basically none.

Sometimes sftp is disabled.

I offhand can't remember why we didn't just scp every time - but I think that may encounter occasional reasons as well, perhaps on odd platforms.




David Reagan

unread,
Sep 12, 2014, 5:04:06 PM9/12/14
to ansible...@googlegroups.com
In that case, I'll just leave it set to use scp.

Thanks for the help! :)

--David Reagan

Reply all
Reply to author
Forward
0 new messages