# FAILED =\> failed to transfer file to /ping

**URL:** <https://forum.ansible.com/t/failed-failed-to-transfer-file-to-ping/11440>\
**Category:** Ansible Project\
**Created:** [April 24, 2012, 5:23am UTC](https://forum.ansible.com/t/failed-failed-to-transfer-file-to-ping/11440 "2012-04-24T05:23:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Sankauskas](https://avatars.discourse-cdn.com/v4/letter/p/ea666f/32.png) [@Peter\_Sankauskas](https://forum.ansible.com/u/Peter_Sankauskas)\
**Post date:** [April 24, 2012, 5:23am UTC](https://forum.ansible.com/t/failed-failed-to-transfer-file-to-ping/11440/1 "2012-04-24T05:23:00Z")

</div>

Hi,

I have just installed ansible on my OSX laptop, and am running through “my first command”. Unfortunately, I am getting the following error:

$ ansible -m ping all -u pas --ask-pass  
SSH password:  
Traceback (most recent call last):  
File “/Users/pas/apps/ansible/lib/ansible/connection.py”, line 163, in put\_file  
sftp.put(in\_path, out\_path)  
File “/Users/pas/Library/Python/2.7/lib/python/site-packages/paramiko/sftp\_client.py”, line 565, in put  
fr = self.file(remotepath, ‘wb’)  
File “/Users/pas/Library/Python/2.7/lib/python/site-packages/paramiko/sftp\_client.py”, line 245, in open  
t, msg = self.\_request(CMD\_OPEN, filename, imode, attrblock)  
File “/Users/pas/Library/Python/2.7/lib/python/site-packages/paramiko/sftp\_client.py”, line 635, in \_request  
return self.\_read\_response(num)  
File “/Users/pas/Library/Python/2.7/lib/python/site-packages/paramiko/sftp\_client.py”, line 682, in \_read\_response  
self.\_convert\_status(msg)  
File “/Users/pas/Library/Python/2.7/lib/python/site-packages/paramiko/sftp\_client.py”, line 710, in \_convert\_status  
raise IOError(errno.EACCES, text)  
IOError: [Errno 13] Permission denied  
127.0.0.1 | FAILED =\> failed to transfer file to /ping

Any ideas what is causing this and how I can fix it?

Thanks,  
Peter

---

<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:** [April 24, 2012, 12:03pm UTC](https://forum.ansible.com/t/failed-failed-to-transfer-file-to-ping/11440/2 "2012-04-24T12:03:01Z")

</div>

Questions:

(A) What version (branch?) of Ansible are you using?

(B) What OS is the host that fails?

It looks like a 0.2.X copy to me because newer Ansible uses different tmpdirs per user (which fixes permission problems) and an exception in a transfer should generally be caught and not fail all programs. But I could be wrong.

(I’m very interested in making things easy to use on OS X by the way, I have some tickets open for adapting the modules for managing nodes but obviously a good working control program on OS X is even more useful. Homebrew packaging might also be nice? Or maybe we just say use pip?)

–Michael

---

<div class="post-metadata">

**Author:** ![Peter\_Sankauskas](https://avatars.discourse-cdn.com/v4/letter/p/ea666f/32.png) [@Peter\_Sankauskas](https://forum.ansible.com/u/Peter_Sankauskas)\
**Post date:** [April 24, 2012, 4:16pm UTC](https://forum.ansible.com/t/failed-failed-to-transfer-file-to-ping/11440/3 "2012-04-24T16:16:20Z")

</div>

Hi Michael,

The version of Ansible I am using is whatever is in the master branch I think:

```auto
git clone git://github.com/ansible/ansible.git

```

The host that fails is also my laptop running OSX 10.7. My hosts file just contains 127.0.0.1.

I am only following instructions here:  
[http://ansible.github.com/gettingstarted.html#getting-ansible](http://ansible.github.com/gettingstarted.html#getting-ansible)

I look forward to your response,  
Peter

---

<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:** [April 24, 2012, 4:40pm UTC](https://forum.ansible.com/t/failed-failed-to-transfer-file-to-ping/11440/4 "2012-04-24T16:40:12Z")

</div>

Ok, the handling of -u is such that it will assume /home/user as the parent for the temp directory, and OS X is /Users/foo. There could be more involved, but I’m quite interested in a patch that  
does this more intelligently.

In other words, not much has been done to handle OS X managed nodes just yet. We’re working on the client (control machine) first, and I imagine that will come later.

Help with this is quite welcome. We’ll also have to make the user, groups, and services module able to detect the OS type and do the right thing (use launchd vs /sbin/service, etc).

–Michael

---

<div class="post-metadata">

**Author:** ![Chris\_Read](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@Chris\_Read](https://forum.ansible.com/u/Chris_Read)\
**Post date:** [April 24, 2012, 4:40pm UTC](https://forum.ansible.com/t/failed-failed-to-transfer-file-to-ping/11440/5 "2012-04-24T16:40:34Z")

</div>

I've found a bug in how \_get\_tmp\_path works on OSX (10.7 in my case) which  
I think is probably causing this problem.

I should have a patch soon...

Chris

---

<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:** [April 24, 2012, 4:42pm UTC](https://forum.ansible.com/t/failed-failed-to-transfer-file-to-ping/11440/6 "2012-04-24T16:42:30Z")

</div>

Yes, this, the shell invocation needs to involve the user’s homedir location ($HOME, etc) most likely.

See if you can fix it to be OS agnostic.

---

<div class="post-metadata">

**Author:** ![Peter\_Sankauskas](https://avatars.discourse-cdn.com/v4/letter/p/ea666f/32.png) [@Peter\_Sankauskas](https://forum.ansible.com/u/Peter_Sankauskas)\
**Post date:** [April 24, 2012, 6:14pm UTC](https://forum.ansible.com/t/failed-failed-to-transfer-file-to-ping/11440/7 "2012-04-24T18:14:09Z")

</div>

Ok great. Please let me know once the patch has been applied and I will pull the master branch again and give it a try.

Peter

---

<div class="post-metadata">

**Author:** ![Chris\_Read](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@Chris\_Read](https://forum.ansible.com/u/Chris_Read)\
**Post date:** [April 24, 2012, 9:19pm UTC](https://forum.ansible.com/t/failed-failed-to-transfer-file-to-ping/11440/8 "2012-04-24T21:19:43Z")

</div>

Yup, that's the easy part, pushed at  
[https://github.com/cread/ansible/commit/dbb4afff50cc65092f2488af09d878be4d772229](https://github.com/cread/ansible/commit/dbb4afff50cc65092f2488af09d878be4d772229)

The hard part is that get\_interfaces in library/setup does not actually  
work for OSX, so we can't use OSX as a client yet (working on it)...

---

<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:** [April 24, 2012, 9:23pm UTC](https://forum.ansible.com/t/failed-failed-to-transfer-file-to-ping/11440/9 "2012-04-24T21:23:50Z")

</div>

> Yup, that’s the easy part, pushed at [https://github.com/cread/ansible/commit/dbb4afff50cc65092f2488af09d878be4d772229](https://github.com/cread/ansible/commit/dbb4afff50cc65092f2488af09d878be4d772229)

pull request please?

> The hard part is that get\_interfaces in library/setup does not actually work for OSX, so we can’t use OSX as a client yet (working on it)…

Yeah, so “does not actually work” is “does not actually work yet” 🙂

Meaning you will want to update it to know when it’s OS X and at least not include those facts, until the time where they can be added in.

I’d be ok with almost no facts for a first pass.

(detect OS X, decide to skip various facts, which may be most of them)
