Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

packet_write_wait: Connection to xxx.xxx.xxx.xxx: Broken pipe

What does it mean when the terminal throw this error and how to solve it?

packet_write_wait: Connection to xxx.xxx.xxx.xxx: Broken pipe

It was just happen today. After it work normally for year. My terminal keep disconnect at a certain time. I had already search on google but most of it is about "Write failed: Broken pipe."

Which I already solved that for years. I just found this new annoyed problems today

like image 431
sthapaun Avatar asked Mar 17 '16 20:03

sthapaun


2 Answers

I experienced this problem as well and spent a few days trying to bisect it.

Like specified, playing with SSH KeepAlive parameters (ClientAliveInterval, ClientAliveCountMax, ServerAliveInterval and ServerAliveCountMax) or kernel TCP parameters (TCPKeepAlive on/off) does not solve the problem.

After playing with USB to Ethernet drivers and tcpdump, I realized the issue was due to the kernel 4.8 I was using. I switched the source (sending side) to 4.4 LTS and the problem disappeared (rsync via ssh and scp were working nicely again). The destination side can remain on 4.8 if you want, in my use case this was working (tested).

On the technical side, we can narrow a little bit the issue thanks to the wireshark dump below I made. We can see the TCP channel of the SSHv2 protocol is being reset (RST flag of TCP set to 1) causing the connection to abort. I don't know the cause of that RST yet. I need to make some bisection from 4.8.1 to 4.8.11 for that. enter image description here

I'm not saying your problem is specifically due to the kernel 4.8, but wrt. the date you posted your question/message, there are high chances you are currently using a kernel more recent than 4.4.

like image 177
wget Avatar answered Nov 11 '22 15:11

wget


If that is an ssh connection, then you might want to make sure you send a keepalive message to the server.

like image 2
Fabiano Francesconi Avatar answered Nov 11 '22 14:11

Fabiano Francesconi