Home Forums .NET libraries Xceed SFTP/FTP for .NET Large file transfer issue

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #21517 |

    I’m using
    Xceed.SSH to download a fairly large file (893mb) from a partner of ours and
    I’m having problems that maybe aren’t related specifically to Xceed.SSH, but
    I’m hoping somebody can tell me what to look for.

     

    Early in
    the morning, I launch the transfer and everything works perfectly. 30 minutes
    later, I try again and this time, the downloaded file is only 871mb and since
    it’s a ZIP file, it’s impossible to extract anything from it as it’s
    incomplete. I try again another 30 minutes later and this time, the file is
    822mb. Then later, 771mb or something… The next morning, it worked again with
    the 893mb file. The file on the partner’s site was later replaced with a 555mb
    file. This time, it worked twice in a row. It’s like there’s some kind of size
    limit for the file based on available memory or something.

     

    I get no
    error logged anywhere, everything looks like it worked fine, but obviously,
    part of the file has been lost somewhere.

     

    Is there an
    option in Xceed.SSH that should be activated to garantee that the download
    really is complete when it ends? Any information about memory management by
    Xceed.SSH would be greatly appreciated.

     

    Here’s the
    code used to download it (Yes, this is VB…)

     

           
    Using sftpSession As SFtpSession = New SFtpSession(_sshFtpClient)

     

               
    Dim repertoireFTPDistant As AbstractFolder = New SFtpFolder(sftpSession,
    Me.RepertoireSFtpDistant)

     

               
    Dim fichierDistant As AbstractFile = repertoireFTPDistant.GetFile(NomFichier)

     

               
    Dim repertoireLocal As AbstractFolder = New DiskFolder(“c:\temp\)

               
    Dim nomSourceTemp = Path.GetRandomFileName()

               
    Dim fichierLocal As AbstractFile = repertoireLocal.GetFile(nomSourceTemp)

     

               
    fichierDistant.CopyTo(fichierLocal, True)

     

            End Using

    Applies to Xceed SFTP for .NET. Imported from legacy forums. Posted by Robin (had 739 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Robin,

    That is definitely strange.

    If you try to download your file repeatedly with a 3rd party GUI SFtp client, like FileZilla <https://filezilla-project.org/> for example, do you get the same results where the downloaded file’s size if often different than the size reported in the file listing?

    In terms of memory, there should be no issue. The size of the file doesn’t affect memory usage because it is downloaded in chunks and the same buffer is reused over and over.

    Just so we’re sure, can you wrap the file transfer code in a try/catch that reports complete exception information in case something happens?

    Each System.Exception object contains a InnerException property. You can loop on each inner exception, taking note of each exception along the way until InnerException is null.

    If you do get an exception, please report it to us (please send it by email at support@xceed.com and include a link to this forum thread for reference).

    For example:

       Try
          fichierDistant.CopyTo(fichierLocal, True)
       Catch exception As Exception
          ‘ Output some information about it
          Console.WriteLine(“–>{0}: {1}” & Constants.vbLf & “{2}”, exception.GetType().Name, exception.Message, exception.StackTrace)

          ‘ Fetch the inner exception
          exception = exception.InnerException

          ‘ While there is an exception
          Do While exception IsNot Nothing
             ‘ Output some information about it
             Console.WriteLine(“–>Inner exception: {0}: {1}” & Constants.vbLf & “{2}”, exception.GetType().Name, exception.Message, exception.StackTrace)

             ‘ Fetch the inner exception
             exception = exception.InnerException
          Loop
       End Try

    Also, can you set the TraceWriter property so the communication with the SFtp server is logged. Then, can you send us the log of the session that is giving you problems so we can analyze it?

    For example:

       Using ssh As New SSHClient()
          ssh.TraceWriter = New StreamWriter(“D:\Log\XceedSFtp.log”, True)
          ssh.AllowTraceWriterClosure = True
          ‘ …
       End Using

    Please note that because your file is large, the log file will be very big (several MB). Please pick a location that has plenty of free space. Because the log file will be big, it may be blocked by the email server and you may have to upload it somewhere for us to download it from. Please send us the download link to support@xceed.com and include a link to this forum thread for reference.

    If you do not have a place to upload the file, let us know by email and we will provide you with an access to one of our FTP servers.

    Applies to Xceed SFTP for .NET. Imported from legacy forums. Posted by Diane [Xceed] (had 262 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Diane,

    Thanks for the reply. Robin is a co-worker of mine, he posted that for me since he is the one responsible for our Xceed Licence.

    I sent the file to the address you provided. Let me know if you need more information and most of all, if you find something!

    Thanks!

    Applies to Xceed SFTP for .NET. Imported from legacy forums. Posted by JP Lambert (had 179 views)

    User (Old forums)
    Member
    Post count: 23064

    Update :

    I found the source of the problem, but haven’t been able to fix it yet. The problem is related to the .NET Remoting service this application is running on. Basically, I have to make a remote call to this server to access anything outside our private network, so there’s a .net remoting service waiting for calls there and that is where Xceed.SSH is being used.

    The downloads are always working when they are completed under 10 minutes. As soon as it takes longer than that, the transfer stops no matter if the file is complete or not. So basically, it usually works when the connexion is faster (early mornings) and then it goes downhill from there. The problem never shows up if we run the application directly on the server outside the .net remoting service.

    The only decent thing I found so far revolves around .NET Remoting LeaseTime settings… but that didn’t change anything so far. So it’s either not the problem, or my changes weren’t made properly.

    If you have an idea, please share! 🙂

    Applies to Xceed SFTP for .NET. Imported from legacy forums. Posted by JP Lambert (had 119 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi JP,

    I sent your update to the developer working on your ticket and am waiting for his feedback. As soon as I receive it I will post it here. Thank you for your patience.

    Update: the developer’s feedback was sent to you by email.

    Applies to Xceed SFTP for .NET. Imported from legacy forums. Posted by Diane [Xceed] (had 695 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.