scp and sftp failing with "client_loop: send disconnect: Broken pipe" (MacOS 11.3 issue?)
As of 2 days ago, my attempts to scp
files from my laptop to servers consistently fail for files larger than ~200 KB with the error "client_loop: send disconnect: Broken pipe" This coincided with an upgrade of my laptop to MacOS 11.3 (from 11 whatever-it-was-before-that).
$ dd if=/dev/urandom of=test.dat count=400 2> /dev/null && ls -l test.dat && scp test.dat $DST
-rw-r--r-- 1 xxxx staff 204800 Apr 28 11:27 test.dat
test.dat 0% 0 0.0KB/s --:-- ETAclient_loop: send disconnect: Broken pipe
lost connection
This is definitely new, as I'm using scp on an almost-daily basis and never had an issue before the update. This behavior is also visible on 2 different server architectures I've used as a destination (NAS and Raspberry Pi - to rule out a coincidental server misconfiguration) as well as using my Linux desktop as a client (no issues as well). What is also weird is that the problem shows for both stock SSH as well as for Homebrew SSH install, which hints of either SSH client configuration issue or a bug in the networking stack. I'm curious if anyone else is observing the same issue. sftp
exhibits the same problem.
On the server side, here's what I get in the log:
May 1 23:27:27 myhost sshd[21774]: Bad packet length 116136902.
May 1 23:27:27 myhost sshd[21774]: ssh_dispatch_run_fatal: Connection from user pi XXX.XXX.XXX.XXX port 59948: Connection corrupted
P.S. One [very imperfect] way to work around this issue is to use a sufficiently low bandwidth limit (-l
option) but it is not great as it makes transfers glacially slow.
I found that disabling "Firewall -> Connection Blocking" on Norton Internet Security solved my case.
I may use -l
option for scp until the issue is fixed, though.