# Trying to fetch without success

**URL:** <https://forum.ansible.com/t/trying-to-fetch-without-success/11669>\
**Category:** Ansible Project\
**Created:** [July 12, 2012, 7:52am UTC](https://forum.ansible.com/t/trying-to-fetch-without-success/11669 "2012-07-12T07:52:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andreas\_Davour](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Andreas\_Davour](https://forum.ansible.com/u/Andreas_Davour)\
**Post date:** [July 12, 2012, 7:52am UTC](https://forum.ansible.com/t/trying-to-fetch-without-success/11669/1 "2012-07-12T07:52:08Z")

</div>

Hi

I have this situation:

[root@se1ts00 yaml]# for i in `cat sx1 | grep -v '\[sx1\]'`; do ssh root@$i ls -l /tmp/repolist; done  
-rw-r--r-- 1 root root 267 Jul 12 06:59 /tmp/repolist  
-rw-r--r-- 1 root root 272 Jul 12 06:59 /tmp/repolist  
-rw-r--r-- 1 root root 270 Jul 12 06:59 /tmp/repolist  
^C  
[root@se1ts00 yaml]# ansible sx1 -c ssh -v -m fetch -a "src=/tmp/repolist dest=/root/andreasda/yaml/repolists"  
betapi00.sx1 | FAILED =\> file or module does not exist: /tmp/repolist  
betbrowsing00.sx1 | FAILED =\> file or module does not exist: /tmp/repolist  
clientapi00.sx1 | FAILED =\> file or module does not exist: /tmp/repolist  
clientapi01.sx1 | FAILED =\> file or module does not exist: /tmp/repolist  
^C

I have run a playbook that collected some information, saved in /tmp/repolist, and now want to fetch it back home for analysis. But, it seems like the FETCH module does not find the file. As can be seen above, the file is at least visible when doing ssh to the machines.

Can anyone spot the error, or is this a mysterious bug?

Thanks.

/andreas

---

<div class="post-metadata">

**Author:** ![Andreas\_Davour](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Andreas\_Davour](https://forum.ansible.com/u/Andreas_Davour)\
**Post date:** [July 12, 2012, 1:07pm UTC](https://forum.ansible.com/t/trying-to-fetch-without-success/11669/2 "2012-07-12T13:07:34Z")

</div>

[snip]

I have verified that:  
ansible sx1 -c ssh -m fetch -a "src=/etc/passwd dest=/tmp/fetch"

does indeed work, but changing the "src" part to that file I want just does not work.

/andreas

---

<div class="post-metadata">

**Author:** ![Andreas\_Davour](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Andreas\_Davour](https://forum.ansible.com/u/Andreas_Davour)\
**Post date:** [July 12, 2012, 1:29pm UTC](https://forum.ansible.com/t/trying-to-fetch-without-success/11669/3 "2012-07-12T13:29:11Z")

</div>

A small difference:

[root@wasp200.sx1 tmp]# ls -l /tmp/anka  
-rw-r--r-- 1 root root 241 Jul 12 13:15 /tmp/anka  
[root@wasp200.sx1 tmp]#

[root@se1ts00 yaml]# ansible testrun -c ssh -m fetch -a "src=/etc/anka dest=/tmp/fetch"  
wasp200.sx1 | success \>\> {  
&nbsp;&nbsp;&nbsp;&nbsp;"changed": false,  
&nbsp;&nbsp;&nbsp;&nbsp;"msg": "missing remote file"  
}

What is going on here??

/andreas

---

<div class="post-metadata">

**Author:** ![CWS](https://avatars.discourse-cdn.com/v4/letter/c/e495f1/32.png) [@CWS](https://forum.ansible.com/u/CWS)\
**Post date:** [July 12, 2012, 1:35pm UTC](https://forum.ansible.com/t/trying-to-fetch-without-success/11669/4 "2012-07-12T13:35:38Z")

</div>

> /tmp/anka

> /etc/anka

Which one is it? /tmp or /etc?

---

<div class="post-metadata">

**Author:** ![Andreas\_Davour](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Andreas\_Davour](https://forum.ansible.com/u/Andreas_Davour)\
**Post date:** [July 12, 2012, 1:50pm UTC](https://forum.ansible.com/t/trying-to-fetch-without-success/11669/5 "2012-07-12T13:50:48Z")

</div>

Sorry, that was a cut and paste error.

ansible testrun -c ssh -m fetch -a "src=/tmp/anka dest=/tmp/fetch"

and

ls -l /tmp/anka  
-rw-r--r-- 1 root root 241 Jul 12 13:15 /tmp/anka

/andreas

---

<div class="post-metadata">

**Author:** ![Andreas\_Davour](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Andreas\_Davour](https://forum.ansible.com/u/Andreas_Davour)\
**Post date:** [July 13, 2012, 9:22am UTC](https://forum.ansible.com/t/trying-to-fetch-without-success/11669/6 "2012-07-13T09:22:33Z")

</div>

After a debugging session on IRC (great support by Dave Hatton & Dag Wieers) we managed to locate an error in the code, in lib/ansible/runner/connection/ssh.py where it does a wrong test.

[https://github.com/ansible/ansible/pull/587](https://github.com/ansible/ansible/pull/587)

/andreas
