During error when running a deployment, you might run into one of the following errors during the file transfer stage:
Server unexpectedly closed the connection.
Which would suggest that your server is closing the connection unexpectedly. We would recommend checking your server FTP/SFTP logs for some further information.
We have found in the past that the FTP/SFTP process can actually shutdown in these cases, specifically within shared hosting environments, which is why the connection doesn't resume.
You would usually only see this error when running an initial, large deployment, during the file transfer process.
If your files already exist on the server you could try and skip the initial deployment, then future deployments should just upload the changed files.