Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
5k views
in .NET FTP by (340 points)
I have a windows application using a SecureFTPConnection object to connect to a Tumbleweed server. I'm getting I've created a monitor form to show the status of the file transfer by adding FTPCommandView and FTPStatusBar objects and setting their .connection properties to the SecureFTPConnection object after it is instantiated and it's properties are set. Everything works fine - the files are uploaded and downloaded, but I see error messages in the Commandview control during the upload.


Command: CONNECT 24.249.236.140
Command: CONNECT 24.249.236.140
Reply: OK
Command: OPEN SFTP
Reply: OK
Command: INIT
Reply: OK
Reply: Error - /test3.txt is not a valid file path
Command: STOR /test3.txt
Reply: Error - /test3.txt is not a valid file path
Reply: OK
Command: CHMOD 755 /test3.txt
Reply: OK
Reply: Error - /TR-2006-45.doc is not a valid file path
Command: STOR /TR-2006-45.doc
Reply: Error - /TR-2006-45.doc is not a valid file path
Reply: OK
Command: CHMOD 755 /TR-2006-45.doc
Reply: OK
Command: ATTR /Outbound
Reply: OK
Command: LIST /Outbound
Reply: OK
Command: CD Outbound
Reply: OK
Command: ATTR /Outbound/cpuz_146.zip
Reply: OK
Command: RETR /Outbound/cpuz_146.zip
Reply: OK
Command: ATTR /Outbound/test3.txt
Reply: OK
Command: RETR /Outbound/test3.txt
Reply: OK
Command: QUIT
Reply: CLOSED OK


This is the code that handles the upload:
' For uploads, leave connection in root (tied to user login account)
        For Each fname As String In filelist
                  If fname.EndsWith(".txt") Then
                    sftp.TransferType = FTPTransferType.ASCII
                Else
                    sftp.TransferType = FTPTransferType.BINARY
                End If
                sftp.UploadFile(fname, System.IO.Path.GetFileName(fname))
                My.Computer.FileSystem.DeleteFile(fname, FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.SendToRecycleBin)
            Next

'Change to /outbound directory on secure server to download files
            Dim FilesToGet() As String = sftp.GetFiles("Outbound")
            sftp.ChangeWorkingDirectory("Outbound")
            For Each fname As String In FilesToGet
                If Not fname.Equals(".") AndAlso Not fname.Equals("..") Then
                        If fname.EndsWith(".txt") Then
                            sftp.TransferType = FTPTransferType.ASCII
                        Else
                            sftp.TransferType = FTPTransferType.BINARY
                        End If
                        sftp.DownloadFile(sftp.LocalDirectory, fname)
               End If
            Next
            sftp.Close()


Pretty straight forward stuff, but I don't understand why I get the errors on the upload.

Here's the full debug log if it helps:


[quote]
INFO [LicenseProperties] 11 Nov 2008 16:19:07.192 : Licence expiry date: 12/31/9999
INFO [LicenseProperties] 11 Nov 2008 16:19:07.204 : Production license
DEBUG [FTPConnection] 11 Nov 2008 16:19:07.207 : Set LocalDirectory='C:\Users\Rocky\Desktop\EDS-Transfer\EDS-Transfer\bin\Release'
INFO [LicenseProperties] 11 Nov 2008 16:19:07.236 : Licence expiry date: 12/31/9999
INFO [LicenseProperties] 11 Nov 2008 16:19:07.237 : Production license
DEBUG [SSHFTPClient] 11 Nov 2008 16:19:07.242 : Setting up fallback kbi prompt based on supplied password
DEBUG [HostNameResolver] 11 Nov 2008 16:19:07.299 : sftp01.af-group.com resolved to 24.249.236.140
DEBUG [SSHFTPClient] 11 Nov 2008 16:19:07.309 : Connecting directly to SFTP server 24.249.236.140:22
DEBUG [SSHFTPClient] 11 Nov 2008 16:19:07.599 : Connected successfully to SFTP server 24.249.236.140:22
DEBUG [SSHConnection] 11 Nov 2008 16:19:07.602 : Beginning protocol negotiation
DEBUG [PlainSocket] 11 Nov 2008 16:19:07.836 : RepeatCallback received 14 bytes
DEBUG [ProtocolNegotiationHandler] 11 Nov 2008 16:19:07.843 : offset=0,length=14
DEBUG [ProtocolNegotiationHandler] 11 Nov 2008 16:19:07.843 : pos=13
INFO [ProtocolNegotiationHandler] 11 Nov 2008 16:19:07.843 : Server version = SSH-2.0-SSHD
DEBUG [SSHConnection] 11 Nov 2008 16:19:07.846 : Server version=SSH-2.0-SSHD
DEBUG [SSH2Connection] 11 Nov 2008 16:19:07.855 : Timeout=120000
DEBUG [SSHConnection] 11 Nov 2008 16:19:07.860 : Sending client version=SSH-2.0-edtFTPnet/PRO-5.1.0.20
DEBUG [SSH2Connection] 11 Nov 2008 16:19:07.865 : Starting key exchange
DEBUG [KeyExchanger] 11 Nov 2008 16:19:07.869 : Sending SSH_MSG_KEXINIT
DEBUG [KeyExchanger] 11 Nov 2008 16:19:07.880 : Client hostkey algorithms=ssh-dss,ssh-rsa
DEBUG [KeyExchanger] 11 Nov 2008 16:19:07.883 : Client ciphers=aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,3des-cbc
DEBUG [KeyExchanger] 11 Nov 2008 16:19:07.883 : Client ciphers=aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,3des-cbc
DEBUG [KeyExchanger] 11 Nov 2008 16:19:07.891 : Client MACs=hmac-sha1,hmac-md5
DEBUG [KeyExchanger] 11 Nov 2008 16:19:07.891 : Client MACs=hmac-sha1,hmac-md5
DEBUG [KeyExchanger] 11 Nov 2008 16:19:07.895 : Client compression algorithms=none,zlib
DEBUG [KeyExchanger] 11 Nov 2008 16:19:07.895 : Client compression algorithms=none,zlib
DEBUG [KeyExchanger] 11 Nov 2008 16:19:07.907 : Sent SSH_MSG_KEXINIT
DEBUG [KeyExchanger] 11 Nov 2008 16:19:07.907 : Reading SSH_MSG_KEXINIT reply
DEBUG [SSH2Connection] 11 Nov 2008 16:19:07.912 : Waiting for packet
DEBUG [PlainSocket] 11 Nov 2008 16:19:08.121 : RepeatCallback received 296 bytes
DEBUG [SSH2PacketBuilder] 11 Nov 2008 16:19:08.128 : ConstructPacket: _cipher=null,len=292
DEBUG [SSH2PacketBuilder] 11 Nov 2008 16:19:08.130 : Writeoffset=296,Readoffset=296
DEBUG [SSH2Connection] 11 Nov 2008 16:19:08.130 : Packet arrived
DEBUG [KeyExchanger] 11 Nov 2008 16:19:08.141 : Processing SSH_MSG_KEXINIT reply
DEBUG [KeyExchanger] 11 Nov 2008 16:19:08.144 : Kex alg=diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
DEBUG [KeyExchanger] 11 Nov 2008 16:19:08.145 : Hostkey alg=ssh-rsa
DEBUG [KeyExchanger] 11 Nov 2008 16:19:08.148 : Cipher CS=blowfish-cbc,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc
DEBUG [KeyExchanger] 11 Nov 2008 16:19:08.149 : Cipher C->S= AES128
DEBUG [KeyExchanger] 11 Nov 2008 16:19:08.149 : Cipher SC=blowfish-cbc,aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc
DEBUG [KeyExchanger] 11 Nov 2008 16:19:08.149 : Cipher S->C= AES128
DEBUG [KeyExchanger] 11 Nov 2008 16:19:08.149 : MAC CS=hmac-sha1,hmac-md5
DEBUG [KeyExchanger

7 Answers

0 votes
by (162k points)
The problem seems to be the '/' in /test3.txt - which is what test3.txt gets resolved to, as it looks like '/' is the current directory.

Is it possible that you need to change directories once you have logged in - perhaps you don't have permissions in '/'?
0 votes
by (340 points)
The upload does work, I just get those errors. It is putting them into my virtual root on the server - that's where they've setup the account for uploading. the files i download are in a subdirectory and that doesn't give me any issues.

Is there any way to suppres these errors? It's not a serious problem, since it does work, but I would like it to be cleaner, if possible.


Thanks,

Rocky
0 votes
by (162k points)
Good that it works, anyway! Will take a look at why you are getting these messages & report back.
0 votes
by (162k points)
When uploading a file, we try to get the attributes of the existing file, if it does exist (so they can be restored after the file is overwritten). Of course mostly the file doesn't exist, so getting the attributes "fails" which is what is reported in the view.

We don't want to just remove the message, but it is clearly incorrect to mark it as an error.

We're looking at making a change so that if it is not known if the file exists, then the message will appear (because omitting it could cause confusion since that message is being sent) but without the "Error".

Sound ok?
0 votes
by (340 points)
We're looking at making a change so that if it is not known if the file exists, then the message will appear (because omitting it could cause confusion since that message is being sent) but without the "Error".

Sound ok?


That sounds great. Thanks very much for the explanation.
0 votes
by (162k points)
We've made a fix - will be in the next release or you can email us for a patched DLL to try out.
0 votes
by (340 points)
We've made a fix - will be in the next release or you can email us for a patched DLL to try out.


You guys are great! I can wait on this for the next release - Thanks a bunch.

Rocky

Categories

...