Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Re: Write failed: Broken pipe error while trasferring file to SSh server via Scp command line.

No, you cannot ask here questions about scp.

Consider asking on

Write failed: Broken pipe error while trasferring file to SSh server via Scp command line.

I'm not sure if I can ask Scp command related questions here but wanted to give a try.

I establish connection to a SSH server via SSH reverse proxy . I have timeout set in reverse proxy as 30 seconds.When I upload a large file(1GB) via psftp command ,its ok without any issues.

Here are the commands used in psftp tool:
psftp -pw password username@hostname:/ -P proxyport

put 112444636.edi

However when I tried to upload the same file via scp commandline I get the below error.Here I'm using Linux box as the client.

scp -P proxyport 112444636.edi username@host:/

Welcome to SFTP Server


Enter password for richsftp


112444636.edi 12% 10MB 546.0KB/s - stalled -Write failed: Broken pipe

112444636.edi 12% 10MB 491.4KB/s - stalled -lost connection

Logs from Proxy side:
SSH Reverse Proxy [2, dest => src] -- Ignoring Exception [ Read timed out]

Logs from server side:
09 10:24:41,771 [2984e113] FINE: @@Buffer add socketDataIn 1263716329, allocated 1, free 1 [com.maverick.nio.SocketConnection]
2016-12-09 10:24:41,771 [2984e113] FINE: @@processSelectionKey: handler is com.maverick.nio.SocketConnection, key is readable, is not writable [com.maverick.nio.Daemon]
2016-12-09 10:24:41,771 [2984e113] FINEST: @@Processing socket READ event [com.maverick.nio.SocketConnection]
2016-12-09 10:24:41,771 [2984e113] FINE: @@Buffer get socketDataIn 1263716329, allocated 1, free 0 [com.maverick.nio.SocketConnection]
2016-12-09 10:24:41,771 [2984e113] FINEST: @@Read -1 bytes from socket [com.maverick.nio.SocketConnection]
2016-12-09 10:24:41,771 [2984e113] FINEST: @@Received EOF from remote host [com.maverick.nio.SocketConnection]
2016-12-09 10:24:41,771 [2984e113] FINEST: @@Closing socket [com.maverick.nio.SocketConnection]

And I see that when transfer the file via psftp ,connection remain open until upload is complete(Its taking a while to complete the file transfer).But in the case of Scp, connection is lost right after 30 secs(timeout specified in proxy setting) while still actively transferring the file.

I turn on sshd logs on server side and see the following log statements frequently when I use psftp but not using Scp commandline.Any idea.Do you think does it caused socket timeout on proxy side which eventually closed the connection in server side.Please .Thanks for your time.

2016-12-09 10:51:00,017 [4170e6e8] FINE: @@Processing SSH_FXP_WRITE [com.maverick.sshd.Subsystem]
2016-12-09 10:51:00,017 [4170e6e8] FINE: @@Sending SSH_FXP_STATUS: : The write completed successfully reason=0 [com.maverick.sshd.Subsystem]