{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/14255","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/14255/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/14255/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/14255/events","html_url":"https://github.com/ansible/ansible/issues/14255","id":130630142,"number":14255,"title":"Ansibile 2.0.0.2 copy fails (could not resolve hostname)","user":{"login":"asivula","id":17022149,"avatar_url":"https://avatars.githubusercontent.com/u/17022149?v=3","gravatar_id":"","url":"https://api.github.com/users/asivula","html_url":"https://github.com/asivula","followers_url":"https://api.github.com/users/asivula/followers","following_url":"https://api.github.com/users/asivula/following{/other_user}","gists_url":"https://api.github.com/users/asivula/gists{/gist_id}","starred_url":"https://api.github.com/users/asivula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asivula/subscriptions","organizations_url":"https://api.github.com/users/asivula/orgs","repos_url":"https://api.github.com/users/asivula/repos","events_url":"https://api.github.com/users/asivula/events{/privacy}","received_events_url":"https://api.github.com/users/asivula/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04"},{"url":"https://api.github.com/repos/ansible/ansible/labels/needs_info","name":"needs_info","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-02T09:49:09Z","updated_at":"2016-02-03T06:41:25Z","closed_at":null,"body":"Trying to copy file to the server with Ansible's copy module. SSH connection works but seems that there's problem with SFTP. Same error happens when trying to execute shell script Ansible's script module.\r\n\r\n**Errors**\r\nERROR! failed to transfer file to /home/jenkins/.ansible/tmp/ansible-tmp-1454402413.7-233202231550330/source:\\n\\nExecuting: program /usr/bin/ssh host xxxx.xxxx.cloudapp.azure.com\r\n\r\nERROR! failed to transfer file to /home/zzz/.ansible/tmp/ansible-tmp-1454403000.94-30402471290978/source:\\n\\nssh: Could not resolve hostname xxx.azure.com\r\n\r\n--> looks that errors are not describing the root reason? Attached the command log with verbose mode on.\r\n\r\n**Version:**\r\n`ansible 2.0.0.2 on Ubuntu 15.10`\r\n\r\n**ansible.cfg changes:**\r\n```\r\n[ssh_connection]\r\ncontrol_path = %(directory)s/%%h-%%p-%%r\r\n```\r\n\r\n**Playbook part that fails:**\r\n```\r\n- name: Copy files for the abc\r\n  copy: src=package.tar.gz dest={{ temp_path }}\r\n```\r\nroles folder contains the role \"kkkk\" + files (package.tar.gz), tasks (main.yml) and vars (main.yml). I had to revise the names to the ticket. \r\n\r\nUsed command:\r\n`ANSIBLE_SSH_PIPELINING=y ANSIBLE_SCP_IF_SSH=y ansible-playbook play.yml -i hosts_inv`\r\n\r\n**Note:**\r\nProblem was shown up after rebooted the Ubuntu remote server on Azure that I use for the ansible script testing. YAML files are developed and ran on the laptop with Ubuntu 15.10 running on Virtual box 5.0.14r105127.\r\n\r\n[Ansible-playbook verbose.txt.txt](https://github.com/ansible/ansible/files/113674/Ansible-playbook.verbose.txt.txt)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/179041338","html_url":"https://github.com/ansible/ansible/issues/14255#issuecomment-179041338","issue_url":"https://api.github.com/repos/ansible/ansible/issues/14255","id":179041338,"user":{"login":"asivula","id":17022149,"avatar_url":"https://avatars.githubusercontent.com/u/17022149?v=3","gravatar_id":"","url":"https://api.github.com/users/asivula","html_url":"https://github.com/asivula","followers_url":"https://api.github.com/users/asivula/followers","following_url":"https://api.github.com/users/asivula/following{/other_user}","gists_url":"https://api.github.com/users/asivula/gists{/gist_id}","starred_url":"https://api.github.com/users/asivula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asivula/subscriptions","organizations_url":"https://api.github.com/users/asivula/orgs","repos_url":"https://api.github.com/users/asivula/repos","events_url":"https://api.github.com/users/asivula/events{/privacy}","received_events_url":"https://api.github.com/users/asivula/received_events","type":"User","site_admin":false},"created_at":"2016-02-03T06:41:25Z","updated_at":"2016-02-03T06:41:25Z","body":"Looks that it tries to take SSH connection from remote Ubuntu to my local Ubuntu and tries to execute SFTP's PUT command before executing the SFTP connection. \r\n\r\nThinking whether IP addresses are changed and the problem is on fingerprints or something else on remote end or local end.\r\n\r\n```\r\nANSIBLE_SSH_PIPELINING=False ansible-playbook play.yml -i hosts_inv -vvv\r\nUsing /etc/ansible/ansible.cfg as config file\r\n1 plays in robot.yml\r\n\r\nPLAY [xxxxxx] ***\r\n\r\nTASK [setup] *******************************************************************\r\n<jenkins@xxxxxxx.azure.com> ESTABLISH SSH CONNECTION FOR USER: None\r\n<jenkins@xxxxxxx.azure.com> SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/osboxes/.ansible/cp/%h-%r -tt jenkins@xxxxxxx.azure.com '( umask 22 && mkdir -p \"$( echo $HOME/.ansible/tmp/ansible-tmp-1454480632.67-132096636680529 )\" && echo \"$( echo $HOME/.ansible/tmp/ansible-tmp-1454480632.67-132096636680529 )\" )'\r\n<jenkins@xxxxxxx.azure.com> PUT /tmp/tmphZSv37 TO /home/jenkins/.ansible/tmp/ansible-tmp-1454480632.67-132096636680529/setup\r\n<jenkins@xxxxxxx.azure.com> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/osboxes/.ansible/cp/%h-%r '[jenkins@xxxxxxx.azure.com]'\r\nfatal: [jenkins@xxxxxxx.azure.com]: UNREACHABLE! => {\"changed\": false, \"msg\": \"ERROR! SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh\", \"unreachable\": true}\r\n\r\nPLAY RECAP *********************************************************************\r\njenkins@xxxxxxx.azure.com : ok=0    changed=0    unreachable=1    failed=0   \r\n\r\nxxxx@xxxxx:~/tttt/bbbb$\r\n```\r\n\r\nBoth ends uses bash\r\n```\r\necho $0\r\n-bash\r\n```\r\n"}}