Discuss (FTP), (FTP on .NET CF) and (FTPS, SFTP and SCP).
no avatar
User

CCericolaDM

Posts

7

Joined

Tue Apr 13, 2010 5:48 am

Strange error: Cannot write to middle of file. Only append i

by CCericolaDM » Wed Feb 15, 2012 11:07 am

The version of the DLL we're using is 7.1.1.20, and we're receiving the stack trace listed below. We use edtFTPnet/PRO to send large files automatically about 20-30 different sites and generally we rarely have any issue. However, this error just started cropping upf or one of the sites and I'm not quite sure what to make of it:

EnterpriseDT.Net.Ftp.Ssh.SFTPException: Cannot write to middle of file. Only append is allowed. (code=4)
at Ak8HPnfQcVdTemEFuFC.dM3oH0ftydOqSaJo1To.W5l53Acx9(Int32 )
at LRNEV9DMRPwFuYNS3Rn.3oAcXHDHi5Voh2MW0pP.mBNyF9y7f()
at LRNEV9DMRPwFuYNS3Rn.3oAcXHDHi5Voh2MW0pP.Write(Byte[] , Int32 , Int32 )
at EnterpriseDT.Net.Ftp.Ssh.SSHFTPClient.nslqTGjRv(Stream , Stream , TransferDirection , String , Int64 )
at EnterpriseDT.Net.Ftp.Ssh.SSHFTPClient.UHYBkOyyL(Stream , String , String , Boolean )
at EnterpriseDT.Net.Ftp.Ssh.SSHFTPClient.Put(String local, String remote, Boolean append)
at EnterpriseDT.Net.Ftp.FTPConnection.UploadFile(String localPath, String remoteFile, Boolean append)
at EnterpriseDT.Net.Ftp.ExFTPConnection.SyncUploadFile(String localPath, String remoteFile, Boolean append)
at EnterpriseDT.Net.Ftp.ExFTPConnection.UploadFile(String localPath, String remoteFile, Boolean append)
at EnterpriseDT.Net.Ftp.FTPConnection.UploadFile(String localPath, String remoteFile)
at EnterpriseDT.Net.Ftp.ConnRecursiveOperations.UploadFile(String path, String remotefile)
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.I3uGCDNBE(FileInfo , Boolean )
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Xg0sRWwXk(DirectoryInfo , String , FileFilter , Boolean )
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Xg0sRWwXk(DirectoryInfo , String , FileFilter , Boolean )
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Xg0sRWwXk(DirectoryInfo , String , FileFilter , Boolean )
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Xg0sRWwXk(DirectoryInfo , String , FileFilter , Boolean )
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Xg0sRWwXk(DirectoryInfo , String , FileFilter , Boolean )
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Put(String localDir, String remoteDir, FileFilter filter, Boolean detectTransferMode)
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Put(String localDir, String remoteDir, FileFilter filter, Boolean detectTransferMode, Boolean recurse)
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Put(String localDir, String remoteDir, String wildcard, Boolean detectTransferMode, Boolean recurse)
at EnterpriseDT.Net.Ftp.ExFTPConnection.SyncUploadMultiple(String localDirectory, String remoteDirectory, String wildcard, Boolean includeSubDirs)
at EnterpriseDT.Net.Ftp.ExFTPConnection.UploadMultiple(String localDirectory, String remoteDirectory, String wildcard, Boolean includeSubDirs)
at EnterpriseDT.Net.Ftp.ExFTPConnection.UploadDirectory(String localDirectory, String remoteDirectory)
at DiscmakersCommon.CDBaby.DigitalDistributionPartners.Processors.GoogleMusicProcessor.UploadFiles() in C:\Development\DiscmakersCommon\DigitalDistributionPartners\Partners\GoogleMusicProcessor.cs:line 535
at DiscmakersCommon.CDBaby.DigitalDistributionPartners.DigitalDistributionAlbumProcessorBase.TransferPackage() in C:\Development\DiscmakersCommon\DigitalDistributionPartners\DigitalDistributionAlbumProcessorBase\DigitalDistributionAlbumProcessorBase_Transfer.cs:line 66
2/14/2012 11:40:14 AM: Error transferring: Cannot write to middle of file. Only append is allowed. (code=4) at Ak8HPnfQcVdTemEFuFC.dM3oH0ftydOqSaJo1To.W5l53Acx9(Int32 )
at LRNEV9DMRPwFuYNS3Rn.3oAcXHDHi5Voh2MW0pP.mBNyF9y7f()
at LRNEV9DMRPwFuYNS3Rn.3oAcXHDHi5Voh2MW0pP.Write(Byte[] , Int32 , Int32 )
at EnterpriseDT.Net.Ftp.Ssh.SSHFTPClient.nslqTGjRv(Stream , Stream , TransferDirection , String , Int64 )
at EnterpriseDT.Net.Ftp.Ssh.SSHFTPClient.UHYBkOyyL(Stream , String , String , Boolean )
at EnterpriseDT.Net.Ftp.Ssh.SSHFTPClient.Put(String local, String remote, Boolean append)
at EnterpriseDT.Net.Ftp.FTPConnection.UploadFile(String localPath, String remoteFile, Boolean append)
at EnterpriseDT.Net.Ftp.ExFTPConnection.SyncUploadFile(String localPath, String remoteFile, Boolean append)
at EnterpriseDT.Net.Ftp.ExFTPConnection.UploadFile(String localPath, String remoteFile, Boolean append)
at EnterpriseDT.Net.Ftp.FTPConnection.UploadFile(String localPath, String remoteFile)
at EnterpriseDT.Net.Ftp.ConnRecursiveOperations.UploadFile(String path, String remotefile)
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.I3uGCDNBE(FileInfo , Boolean )
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Xg0sRWwXk(DirectoryInfo , String , FileFilter , Boolean )
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Xg0sRWwXk(DirectoryInfo , String , FileFilter , Boolean )
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Xg0sRWwXk(DirectoryInfo , String , FileFilter , Boolean )
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Xg0sRWwXk(DirectoryInfo , String , FileFilter , Boolean )
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Xg0sRWwXk(DirectoryInfo , String , FileFilter , Boolean )
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Put(String localDir, String remoteDir, FileFilter filter, Boolean detectTransferMode)
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Put(String localDir, String remoteDir, FileFilter filter, Boolean detectTransferMode, Boolean recurse)
at EnterpriseDT.Net.Ftp.AbstractRecursiveOperations.Put(String localDir, String remoteDir, String wildcard, Boolean detectTransferMode, Boolean recurse)
at EnterpriseDT.Net.Ftp.ExFTPConnection.SyncUploadMultiple(String localDirectory, String remoteDirectory, String wildcard, Boolean includeSubDirs)
at EnterpriseDT.Net.Ftp.ExFTPConnection.UploadMultiple(String localDirectory, String remoteDirectory, String wildcard, Boolean includeSubDirs)
at EnterpriseDT.Net.Ftp.ExFTPConnection.UploadDirectory(String localDirectory, String remoteDirectory)
at XX.YY.ZZ.AA.BB.UploadFiles() in
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: Strange error: Cannot write to middle of file. Only appe

by support2 » Wed Feb 15, 2012 12:55 pm

Probably best to send us a log file at the All logging level. Zipped please. Also your DLL version is two years old - you should consider upgrading.
no avatar
User

CCericolaDM

Posts

7

Joined

Tue Apr 13, 2010 5:48 am

Re: Strange error: Cannot write to middle of file. Only appe

by CCericolaDM » Thu Feb 16, 2012 6:58 am

no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: Strange error: Cannot write to middle of file. Only appe

by support2 » Thu Feb 16, 2012 7:00 am

no avatar
User

CCericolaDM

Posts

7

Joined

Tue Apr 13, 2010 5:48 am

Re: Strange error: Cannot write to middle of file. Only appe

by CCericolaDM » Fri Feb 17, 2012 11:22 am

no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: Strange error: Cannot write to middle of file. Only appe

by support2 » Fri Feb 17, 2012 1:15 pm

The log file shows what is happening:

ALL [SFTPMessage] 15 Feb 2012 16:04:30.456 : Reply : Name=SSH_FXP_STATUS,Type=101,RequestID=65251
errorCode=0
errorMessage=The write completed successfully
language=
ALL [SFTPMessage] 15 Feb 2012 16:04:30.456 : Reply : Name=SSH_FXP_STATUS,Type=101,RequestID=65309
errorCode=4
errorMessage=Cannot write to middle of file. Only append is allowed.
language=
ERROR [SFTPSubsystem] 15 Feb 2012 16:04:30.456 : VerifyRequestOK: Cannot write to middle of file. Only append is allowed.

Essentially, what I think is happening is that messages are arriving at the server out of order. It can't cope with that and so you get this message (because the last message is trying to write at the wrong offset).

The best solution for a server that can't cope with this is to switch off parallel transfer mode, i.e. set ParallelTransferMode = false. This will slow transfers down (as every message must be acknowledge in order) but in this case you probably can't do much about it.
no avatar
User

CCericolaDM

Posts

7

Joined

Tue Apr 13, 2010 5:48 am

Re: Strange error: Cannot write to middle of file. Only appe

by CCericolaDM » Fri Feb 17, 2012 1:19 pm


Who is online

Users browsing this forum: No registered users and 2 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron