# Problem with file transfer

**URL:** <https://forum.ansible.com/t/problem-with-file-transfer/37788>\
**Category:** Ansible Project\
**Tags:** awx\
**Created:** [March 21, 2023, 10:25am UTC](https://forum.ansible.com/t/problem-with-file-transfer/37788 "2023-03-21T10:25:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Axel\_Kurowski](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@Axel\_Kurowski](https://forum.ansible.com/u/Axel_Kurowski)\
**Post date:** [March 21, 2023, 10:25am UTC](https://forum.ansible.com/t/problem-with-file-transfer/37788/1 "2023-03-21T10:25:39Z")

</div>

Hello,

I have two hosts and I would like to transfer a file between them.

So I have the **file.tar.gz** and I need to copy it **from HOST1 to HOST2**.

When we execute the playbook, it hangs on the step:

Using module file /usr/lib/python2.7/site-packages/ansible/modules/files/synchronize.py  
\<129.103.138.122\> PUT /var/lib/awx/.ansible/tmp/ansible-local-771BsaW/tmpAa0jFW TO /home/testacc2/.ansible/tmp/ansible-tmp-1679047385.72-56-125137671798457/AnsiballZ\_synchronize.py  
\<129.103.138.122\> SSH: EXEC scp -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“testacc2”’ -o ConnectTimeout=60 -C -o ControlMaster=auto -o ControlPersist=30m -o ServerAliveInterval=120 -o ServerAliveCountMax=20 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null ‘-oProxyCommand=ssh -i $JH3\_SSH\_PRIVATE\_KEY -W %h:%p -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oProxyCommand=“ssh -i $JH2\_SSH\_PRIVATE\_KEY -W 198.18.182.66:22 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oProxyCommand=\“ssh -i $JH1\_SSH\_PRIVATE\_KEY -W 146.22.163.188:22 -m hmac-sha1 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null [autotest01@100.79.241.7](mailto:autotest01@100.79.241.7)\” [autotest@146.22.163.188](mailto:autotest@146.22.163.188)” [connector@198.18.182.66](mailto:connector@198.18.182.66)’ -o ControlPath=/tmp/bwrap\_20466389\_\_xp6awau/awx\_20466389\_8ozc1hbg/cp/90ab54c264 /var/lib/awx/.ansible/tmp/ansible-local-771BsaW/tmpAa0jFW ‘[129.103.138.122]:/home/testacc2/.ansible/tmp/ansible-tmp-1679047385.72-56-125137671798457/AnsiballZ\_synchronize.py’  
\<129.103.138.122\> (0, ‘’, ‘’)  
\<129.103.138.122\> ESTABLISH SSH CONNECTION FOR USER: testacc2  
\<129.103.138.122\> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“testacc2”’ -o ConnectTimeout=60 -C -o ControlMaster=auto -o ControlPersist=30m -o ServerAliveInterval=120 -o ServerAliveCountMax=20 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null ‘-oProxyCommand=ssh -i $JH3\_SSH\_PRIVATE\_KEY -W %h:%p -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oProxyCommand=“ssh -i $JH2\_SSH\_PRIVATE\_KEY -W 198.18.182.66:22 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oProxyCommand=\“ssh -i $JH1\_SSH\_PRIVATE\_KEY -W 146.22.163.188:22 -m hmac-sha1 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null [autotest01@100.79.241.7](mailto:autotest01@100.79.241.7)\” [autotest@146.22.163.188](mailto:autotest@146.22.163.188)” [connector@198.18.182.66](mailto:connector@198.18.182.66)’ -o ControlPath=/tmp/bwrap\_20466389\_\_xp6awau/awx\_20466389\_8ozc1hbg/cp/90ab54c264 129.103.138.122 ‘/bin/sh -c ‘"’“‘chmod u+x /home/testacc2/.ansible/tmp/ansible-tmp-1679047385.72-56-125137671798457/ /home/testacc2/.ansible/tmp/ansible-tmp-1679047385.72-56-125137671798457/AnsiballZ\_synchronize.py && sleep 0’”’“‘’  
\<129.103.138.122\> (0, ‘’, ‘’)  
\<129.103.138.122\> ESTABLISH SSH CONNECTION FOR USER: testacc2  
\<129.103.138.122\> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ‘User=“testacc2”’ -o ConnectTimeout=60 -C -o ControlMaster=auto -o ControlPersist=30m -o ServerAliveInterval=120 -o ServerAliveCountMax=20 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null ‘-oProxyCommand=ssh -i $JH3\_SSH\_PRIVATE\_KEY -W %h:%p -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oProxyCommand=“ssh -i $JH2\_SSH\_PRIVATE\_KEY -W 198.18.182.66:22 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oProxyCommand=\“ssh -i $JH1\_SSH\_PRIVATE\_KEY -W 146.22.163.188:22 -m hmac-sha1 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null [autotest01@100.79.241.7](mailto:autotest01@100.79.241.7)\” [autotest@146.22.163.188](mailto:autotest@146.22.163.188)” [connector@198.18.182.66](mailto:connector@198.18.182.66)’ -o ControlPath=/tmp/bwrap\_20466389\_\_xp6awau/awx\_20466389\_8ozc1hbg/cp/90ab54c264 -tt 129.103.138.122 '/bin/sh -c '”‘“'sudo -H -S -n -u root /bin/sh -c '”’“'”‘"’“'”‘"’“‘echo BECOME-SUCCESS-bexovkdvovirkrfatdyeahwvoismueds ; /usr/bin/python /home/testacc2/.ansible/tmp/ansible-tmp-1679047385.72-56-125137671798457/AnsiballZ\_synchronize.py’”‘"’“'”‘"’“'”‘"’ && sleep 0’“'”‘’

What is suspicious… that I could execute the playbook for opposite side and it works fine…

So I am able to copy the file from HOST2 to HOST1.

Could You please support me what is wrong here? Some packages for python are missed on the HOST1 ? I am a bit confused because seems that we have the same packages installed on both sides.

---

<div class="post-metadata">

**Author:** ![Axel\_Kurowski](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@Axel\_Kurowski](https://forum.ansible.com/u/Axel_Kurowski)\
**Post date:** [March 22, 2023, 7:49am UTC](https://forum.ansible.com/t/problem-with-file-transfer/37788/2 "2023-03-22T07:49:00Z")

</div>

I have found the error… I have registered manually the public key from root host1 into the target user host2. It works fine.
