I am using the SecureFTPClient to download a file off an SFTP server. The file is approx. 106 MBs and it will download the first 50 or so before it stops and I get this error (logged using the EnterpriseDT.Util.Debug.Logger) - see
Error From Log section below.
The interesting thing is that if I try to download using WS FTP Pro it downloads the entire file fine. Both of these tests being done from the same server.
C# Code (some pieces have been consolidated for brevity)
private SecureFTPConnection ftpclient;
ftpclient.ServerAddress = this.SiteAddress;
ftpclient.UserName = this.UserId;
ftpclient.Password = this.Password;
ftpclient.Protocol = FileTransferProtocol.SFTP;
ftpclient.ServerPort = Port;
ftpclient.ServerValidation = ValidationType;
if (SSHFile != String.Empty)
{
ftpclient.KnownHosts.ClearKnownHosts();
ftpclient.KnownHosts.AddKnownHost(ftpclient.ServerAddress, SSHFile);
ftpclient.SSHWindowSize = 4096;
}
ftpclient.ConnectMode = FTPConnectMode.PASV;
ftpclient.Connect();
if (chdir != null)
ChangeDirectory(chdir);
ftpclient.DownloadFile(dfile, pullfilename);
Error From LogDEBUG [ChannelDataWindow] 29 Mar 2013 08:30:45.602 : Remote window size decreased to 275468
DEBUG [PlainSocket] 29 Mar 2013 08:30:45.821 : RepeatCallback received 34916 bytes
DEBUG [SSH2Connection] 29 Mar 2013 08:30:45.821 : ProcessPacket pt=SSH_MSG_CHANNEL_DATA
DEBUG [SSH2Channel] 29 Mar 2013 08:30:45.821 : Local window size increased to 4096
DEBUG [SFTPChannelReceiver] 29 Mar 2013 08:30:45.821 : NextMessageLength=65544
DEBUG [SSH2PacketBuilder] 29 Mar 2013 08:30:45.821 : Writeoffset=34916,Readoffset=34916
DEBUG [PlainSocket] 29 Mar 2013 08:30:45.821 : RepeatCallback received 30820 bytes
DEBUG [SSH2Connection] 29 Mar 2013 08:30:45.821 : ProcessPacket pt=SSH_MSG_CHANNEL_DATA
DEBUG [SSH2Channel] 29 Mar 2013 08:30:45.821 : Local window size increased to 4096
DEBUG [SFTPMessageFactory] 29 Mar 2013 08:30:45.821 : Received message (type=103,len=65544)
DEBUG [SFTPMessageStore] 29 Mar 2013 08:30:45.821 : AddMessage(876) - added to store
DEBUG [SSH2PacketBuilder] 29 Mar 2013 08:30:45.821 : Writeoffset=30820,Readoffset=30820
ALL [SFTPMessage] 29 Mar 2013 08:30:45.821 : Reply : Name=SSH_FXP_DATA,Type=103,RequestID=876
datalen=65535
ALL [SFTPMessage] 29 Mar 2013 08:30:45.821 : Send : Name=SSH_FXP_READ,Type=5,RequestID=877
handle=323236,offset=56687775,len=65535
DEBUG [SSH2Channel] 29 Mar 2013 08:30:45.821 : Transmit 28 bytes
DEBUG [ChannelDataWindow] 29 Mar 2013 08:30:45.821 : Remote window size decreased to 275440
DEBUG [PlainSocket] 29 Mar 2013 08:30:46.040 : RepeatCallback received 35028 bytes
ERROR [SFTPChannelReceiver] 29 Mar 2013 08:30:46.040 : MAC Error : Cit6Yu7UVejUuOI7S0F.p5NYZP7r6ZctL2AlB1E: MAC Error
Cit6Yu7UVejUuOI7S0F.p5NYZP7r6ZctL2AlB1E: MAC Error
at 09qpnOIKEsJSLDAe6hl.tleIFgIepw0fwQBSHi8.O2CvPR22T(Byte[] , Byte[] , Int32 , 6RKQN8jOsmsxVDpKQcX , Int32 , lTQcDbjXEr3o1CMseVq )
at XXA54uIldUcwlt2tS46.v6jVN7I5UwbKsXquhDT.X015F6Ga3()
at XXA54uIldUcwlt2tS46.v6jVN7I5UwbKsXquhDT.7GClBXRCtp(Byte[] , Int32 , Int32 )
ERROR [SFTPMessageStore] 29 Mar 2013 08:30:46.055 : GetMessage - throwing stored exception
ERROR [SFTPMessageStore] 29 Mar 2013 08:30:46.055 : MAC Error : Cit6Yu7UVejUuOI7S0F.p5NYZP7r6ZctL2AlB1E: MAC Error
Cit6Yu7UVejUuOI7S0F.p5NYZP7r6ZctL2AlB1E: MAC Error
at 78BC9xqPkReke5HoVgp.uhEAitqMGfTIkL2KK2R.PGQSWgVWx(Int32 )
ALL [SFTPMessage] 29 Mar 2013 08:30:46.055 : Send : Name=SSH_FXP_CLOSE,Type=4,RequestID=878
handle=323236