Error when deploying with git (dokku) - timeout / broken pipe

独自空忆成欢 提交于 2019-12-01 06:10:44

Firstly, this

    git config http.postBuffer 209715200 / git config ssh.postBuffer 209715200

Won't make any difference, as long as you are pushing over SSH(port 22):

packet_write_wait: Connection to some-ip port 22: Broken pipe

Your error has nothing to do with configuration, but with bad internet connection/low bandwidth somewhere between you and destination point, which results in big size packets being broke in tcp and lost.

It's extensively discussed here. Try:

1) switching to http (this will increase size limit for brake due to a bit smaller header overhead)

2) decreasing repo size (repack or gc --aggressive)

However, this will work, only if you are on the verge of getting it there. If your connection is really bad you can't physically transfer big( also because containing multiple headers) packets of data, then the only fix:

Increase your bandwidth (switch to LAN, change network etc). It may be a requirement both on client and receiving end.

This generally occurs when the server runs out of memory. You can either add more ram to your server or setup swap space. The follow script will create 2GB of swap space.

sudo install -o root -g root -m 0600 /dev/null /swapfile
dd if=/dev/zero of=/swapfile bs=1k count=2048k
mkswap /swapfile
swapon /swapfile
echo "/swapfile       swap    swap    auto      0       0" | sudo tee -a /etc/fstab
sudo sysctl -w vm.swappiness=10
echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf

Also try Git Garbage Collection and Clearing Application cache.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!