# Deploy task "copy project local files" fails after updating to latest trellis

**URL:** <https://discourse.roots.io/t/deploy-task-copy-project-local-files-fails-after-updating-to-latest-trellis/5605>\
**Category:** trellis\
**Created:** [January 2, 2016, 2:26am UTC](https://discourse.roots.io/t/deploy-task-copy-project-local-files-fails-after-updating-to-latest-trellis/5605 "2016-01-02T02:26:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruslankomjakov](https://discourse.roots.io/user_avatar/discourse.roots.io/ruslankomjakov/32/6490_2.png) [@ruslankomjakov](https://discourse.roots.io/u/ruslankomjakov)\
**Post date:** [January 2, 2016, 2:26am UTC](https://discourse.roots.io/t/deploy-task-copy-project-local-files-fails-after-updating-to-latest-trellis/5605/1 "2016-01-02T02:26:40Z")

</div>

Deploy fails after updating to latest Trellis. I’ve updated trellis for my project and successfully reprovisioned staging server, but deploy fails on copying local files task . Re-running deploy command using -vvvv, prints the following SSH debug output:

```auto
TASK: [deploy | Copy project local files] *************************************
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 14 100 14 0 0 22 0 --:--:-- --:--:-- --:--:-- 22
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 14 100 14 0 0 23 0 --:--:-- --:--:-- --:--:-- 23
<127.0.0.1> ESTABLISH CONNECTION FOR USER: web
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 14 100 14 0 0 23 0 --:--:-- --:--:-- --:--:-- 23
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 14 100 14 0 0 24 0 --:--:-- --:--:-- --:--:-- 24

<127.0.0.1> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/xxxxx/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 127.0.0.1 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1451685791.32-79872105840475 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1451685791.32-79872105840475 && echo $HOME/.ansible/tmp/ansible-tmp-1451685791.32-79872105840475'
fatal: [xx.xxx.xxx.xxx -> 127.0.0.1] => SSH Error: ssh: connect to host 127.0.0.1 port 22: Connection refused
    while connecting to 127.0.0.1:22
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.

PLAY RECAP ********************************************************************
           to retry, use: --limit @/Users/xxxx/deploy.retry

xx.xxx.xxx.xxx : ok=8 changed=3 unreachable=1 failed=0
localhost : ok=0 changed=0 unreachable=0 failed=0

```

Any ideas what’s happening here?

---

<div class="post-metadata">

**Author:** ![fullyint](https://discourse.roots.io/letter_avatar_proxy/v4/letter/f/f19dbf/32.png) [@fullyint](https://discourse.roots.io/u/fullyint)\
**Post date:** [January 2, 2016, 2:33am UTC](https://discourse.roots.io/t/deploy-task-copy-project-local-files-fails-after-updating-to-latest-trellis/5605/2 "2016-01-02T02:33:52Z")

</div>

**Edit: [roots/trellis#455](https://github.com/roots/trellis/pull/455) provides superior solution.**

@ruslankomjakov See if [roots/trellis#454](https://github.com/roots/trellis/pull/454) resolves it for you. Sorry about this problem. Try editing your `hosts/development` file:

```diff
- 127.0.0.1
+ 127.0.0.1 ansible_connection=local

```

Alternatively, you could specify the command as:

```auto
ansible-playbook deploy.yml -i hosts/staging -e "env=staging site=example.com"

```

---

<div class="post-metadata">

**Author:** ![ruslankomjakov](https://discourse.roots.io/user_avatar/discourse.roots.io/ruslankomjakov/32/6490_2.png) [@ruslankomjakov](https://discourse.roots.io/u/ruslankomjakov)\
**Post date:** [January 2, 2016, 2:53am UTC](https://discourse.roots.io/t/deploy-task-copy-project-local-files-fails-after-updating-to-latest-trellis/5605/3 "2016-01-02T02:53:09Z")

</div>

@fullyint This fix resolves it! Thank you for the quick reply and fix 👍

---

<div class="post-metadata">

**Author:** ![fullyint](https://discourse.roots.io/letter_avatar_proxy/v4/letter/f/f19dbf/32.png) [@fullyint](https://discourse.roots.io/u/fullyint)\
**Post date:** [January 2, 2016, 8:39pm UTC](https://discourse.roots.io/t/deploy-task-copy-project-local-files-fails-after-updating-to-latest-trellis/5605/4 "2016-01-02T20:39:29Z")

</div>

@ruslankomjakov Note that @swalkinshaw just merged a better fix in [roots/trellis#455](https://github.com/roots/trellis/pull/455)

---

<div class="post-metadata">

**Author:** ![ruslankomjakov](https://discourse.roots.io/user_avatar/discourse.roots.io/ruslankomjakov/32/6490_2.png) [@ruslankomjakov](https://discourse.roots.io/u/ruslankomjakov)\
**Post date:** [January 2, 2016, 10:17pm UTC](https://discourse.roots.io/t/deploy-task-copy-project-local-files-fails-after-updating-to-latest-trellis/5605/5 "2016-01-02T22:17:49Z")

</div>

@fullyint Noted, thanks!
