Send failure: Connection reset by peer - Upload continues?
Question
I use bitbucket pipelines to build my project and git-ftp to upload it afterwards

And sometimes everything works great and sometimes some files are just not uploaded with error message: Send failure: Connection reset by peer but it continues and won't stop or retry. How can I fix this, because of this I am never sure all files are uploaded and up to date.
Environment
It always install last version of git-ftp I think

Hi! This is a really good question. Git-ftp uses curl to upload files and it doesn't stop on errors. That was first reported in #9 and is still not fixed. What you can do as a workaround:
# Save all output in a file:
git ftp push -vv [all your options...] 2>&1 | tee /tmp/git-ftp-push.log
# Check for errors:
if grep "Send failure" /tmp/git-ftp-push.log; then
echo "Oh no, we have to do it again!"
exit 1
fi
Your pipeline should fail there. I also noticed that you use the -a option. It means that it always uploaded all files and you are not using the benefit of Git-ftp to upload only changed files. The more files you upload, the higher the chance for failures.
curl as of 7.52.0 has a "--fail-early" option.
Fail and exit on the first detected transfer error.
Using this option, curl will instead return an error on the first transfer that fails, independent of the amount of URLs that are given on the command line. This way, no transfer failures go undetected by scripts and similar.
Allowing that option (on the command line and in the config file) will allow those with curl >= 7.52 to fail right away and see what the issue is.