6

I keep getting a packet_write_wait: Broken Pipe error on my EC2 SSH connections after a period of inactivity.

I've tried modifying the ServerAliveInterval & ClientAliveInterval settings with different values ranging from 5 to 120. I've also tried changing the TCPKeepAlive setting to no or yes. I've tried applying these settings to the config at /etc/ssh/sshd_config and ~/.ssh/config (I've tried these in a Host * block and a Host SERVER.COM block.)

Yet, I keep getting disconnected with a packet_write_wait: Broken Pipe error. How do I correct this issue?

  • Try pinging the host for the entire time of the connection and see if you see periods of dropped packets – R. S. Nov 04 '16 at 04:28

1 Answers1

2

This means that there is a huge packet loss for a long time or route change between you and AWS (not necessarily your provider, it might be your router or intermediate provider too), so even tcp keepalives are left unanswered. Inspect your traffic, every sent and received packet on both sides with wireshark/tshark in background. If you'll see that data is not delivered or there is a TCP retransmission - this is where the problem belongs to.

GioMac
  • 4,544
  • 4
  • 27
  • 41
  • This seems to be exactly the case, but how can we go about fixing this? I looked at wireshark/tshark, but not sure how to figure anything out with that. I can SSH into EC2 via another ip address, but this one where the broken pipe occurs still won't work. Tried all the keepalives on both ends. Not sure how to resolve this at this point. – Jordan Aug 08 '17 at 14:40