This project is read-only.

sftp or scp upload fails for large files

Jan 18, 2012 at 11:53 PM

Hi,

I am facing issue uploading large files using sftp or scp (Renci.SshNet).

Twice failed after uploading  1071972960 bytes.

Error Message:

"An established connection was aborted by the software in your host machine"

 

Code Snippet:

Dim pkeyFile As PrivateKeyFile = Nothing 

Dim client As SftpClient = Nothing       

Dim myFileStream As System.IO.FileStream = Nothing

Try           

pkeyFile = New PrivateKeyFile(privateKey, FTPPassword)           

Dim fi As New FileInfo(inputfile)           

client = New SftpClient(FTPHost, FTPPort, FTPUsername, pkeyFile)           

client.OperationTimeout = New TimeSpan(2, 0, 0)           

client.BufferSize = 1024 * 16           

client.KeepAliveInterval = New TimeSpan(0, 1, 0)           

client.Connect()

myFileStream = New System.IO.FileStream(inputfile, FileMode.Open, FileAccess.Read)           

client.UploadFile(myFileStream, "/home/" & FTPUsername & ftppath)

Return "success"       

Catch ex As Exception           

Throw New Exception("Sftp upload fails. " & ex.Message)       

Finally           

client.Disconnect()            

myFileStream.Close()               

myFileStream.Dispose()            

client.Dispose()           

myFileStream = Nothing           

client = Nothing       

End Try

 

Please guide me how to upload large files using sftp or scp.

Thanks,

Karthik

Jan 23, 2012 at 3:09 PM

I to have an same problem. But sometimes my server doesn't seem do disconnect user from its side.

Coordinator
Jan 23, 2012 at 3:25 PM

I will take a look at it then and let you know what I find.

 

Thanks,

Oleg

Coordinator
Jan 23, 2012 at 4:31 PM

 

Hey guys,

 

Just as I suspected, I have a problem during rekeing proccess:

debug1: need rekeying
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: client->server 3des-cbc hmac-md5 none
debug1: kex: server->client 3des-cbc hmac-md5 none
protocol error during kex, no DH_GEX_REQUEST: 94

I will fix it as soon as I can then and will keep you posted.

 

Thanks for reporting it.

 

Oleg

Coordinator
Jan 24, 2012 at 2:50 PM

Hi,

 

I just checked in a new code (14016) that fixes large file transfer problem.

 

In fact, there were two problems related to this issue which now should work.

 

Please check it out and let me know if you still have a problem.

 

Thanks,

Oleg