I had issues with running sudo commands during the deploy.
I changed all sudo commands to have the following format:
`execute :sudo, "mv /tmp/#{fetch(:application)} #{fetch(:nginx_config_path)}/#{fetch ...`
And then everything worked.

Just changing that is not ideal I think - here's a [link](https://github.com/capistrano/capistrano/blob/master/README.md#tasks) to capistrano 3 readme that explains how `execute` should be used.