Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.8k views
in .NET FTP by (320 points)
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

6 Answers

0 votes
by (162k points)
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.
0 votes
by (320 points)
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.


Upgrading to the 8.0 version, and am now in the process of getting a log in the all mode. Where should I send this once I can reproduce?
0 votes
by (162k points)
support at enterprisedt dot com
0 votes
by (320 points)
support at enterprisedt dot com


Log file sent - sorry for the delay.
0 votes
by (162k points)
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.
0 votes
by (320 points)
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.



Thanks - I'll give it a try and see what happens.

Categories

...