Home Forums .NET libraries Xceed SFTP/FTP for .NET Asyncftp throws an error – An error occurred while reading from or writing to the data channel

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

    Hi,

    We are using AsyncFTP for sending files to the client system. We are getting an error while sending file.
    Find the following error message and help me how to fix it. I am using C#

    Xceed.Ftp.FtpIOException: An error occurred while reading from or writing to the data channel. —> System.IO.IOException: I/O error occurred.
       at Xceed.Utils.Security.Ssl.SecureNetworkStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
       at Xceed.Ftp.Engine.FtpDataConsumerCommand.ReadCompleted(IAsyncResult result)
       — End of inner exception stack trace —
       at Xceed.Ftp.Engine.FtpCommandSequence.EndExecute(IAsyncResult asyncResult)
       at Xceed.Ftp.AsyncFtpClient.EndSendFile(IAsyncResult asyncResult)
       at SnapShotExtract.DisabilityExtractFTP.FTPFile(String path, String ftpaddr, String usrname, String pwd)
       at SnapShotExtract.DisabilityExtractFTP.ExecuteRoutine()

     

     

     

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Rajkumar (had 10681 views)

    Xceed Support
    Member
    Post count: 5658

    Hi, 

      would it be possible to get a code snippet please?

    Thank you 

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Chris [Xceed] (had 414 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

     Thanks for your response.

    Here the code snippet

    Xceed.Ftp.AsyncFtpClient fc =

    new Xceed.Ftp.AsyncFtpClient();

    IAsyncResult result;

    result = fc.BeginConnect(ftpaddr,

    null,null);

    while (!result.IsCompleted)

    {}

    fc.EndConnect(result);

    result = fc.BeginLogin(usrname,pwd,

    null,null);

    while (!result.IsCompleted)

    {}

    fc.EndLogin(result);

     

    result = fc.BeginSendFile(path,

    null, null);

     

    while (!result.IsCompleted)

    {}

    fc.EndSendFile(result);

    result = fc.BeginDisconnect(

    null, null);

    while (!result.IsCompleted)

    {}

    fc.EndDisconnect(result);

    fc =

    null;

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Rajkumar (had 655 views)

    Xceed Support
    Member
    Post count: 5658

    Hi, 

      would it be possible to set the TraceWriter property of the AsyncFtpClient and post the log please?

    fc.TraceWriter = new StreamWriter( @”D:\ftp.log”, true );

     This would  help us identify some problems.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Chris [Xceed] (had 498 views)

    User (Old forums)
    Member
    Post count: 23064

    Actually this happens on our live clusters. It is not that easy to add the line and deploy it to live. We can’t do the trial and error over there. lot of obstacles are there. Is there any other choice?

     –Raj

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Rajkumar (had 397 views)

    User (Old forums)
    Member
    Post count: 23064

    I can provide one more detail.
    We are using the Xceed.Ftp version 3.2.7463.0 in our live server.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Rajkumar (had 438 views)

    User (Old forums)
    Member
    Post count: 23064

    Does this happen for every file?  If so, has it worked before?  Where there a change in the firewall configuration or timeout?  Does it happen right away when calling the SendFile() method, or after a delay?  If it does not happen with every file, is there a pattern in the files on which it happens?  Do you connect to other server?  If so, does it work for those other server?

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by André (had 417 views)

    User (Old forums)
    Member
    Post count: 23064

    Client receives the partially completed file on their end with server error. But the file what we generate was fully completed and stored in our server.  It is always CSV format file. We haven’t changed any firewall setting on the server. But other service sending file to the same ftp address properly.

    –raj

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Rajkumar (had 612 views)

    Xceed Support
    Member
    Post count: 5658

    Does the size of the problematic files is 8Kb or less?

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Chris [Xceed] (had 334 views)

    User (Old forums)
    Member
    Post count: 23064

    File size is more than 8Kb.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Rajkumar (had 535 views)

    User (Old forums)
    Member
    Post count: 23064

    At this time, it is difficult to tell what could be the problem.  We would need access to the server, or at least a way to reproduce the issue.  However, we  can only put more time into this if you are entitled to support.  If this is the case, I suggest you send a request to support@xceed.com, with a link referencing this post, so we can investigate this further.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by André (had 720 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

    Thanks for your help. There are two services running on the server and both are using Async FTP to send the file to the client server. And both the services run at the same time. Will that make any problem?

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Rajkumar (had 491 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

     I got the LOG from live server.

    Here the log file which sent file properly

    Connected to 166.109.4.90:21 on 1/8/2009 @ 2:20:09 PM
    < 220 Welcome to Southern Westchester BOCES – LHRIC -> Serv-U FTP Server v6.1 for WinSock ready…
    > USER iepduser
    < 331 User name okay, need password.
    > PASS xxxxxx
    < 230 User logged in, proceed.
    > TYPE I
    < 200 Type set to I.
    > PASV
    < 227 Entering Passive Mode (166,109,4,90,6,24)
    > STOR 500108030000_TOD1_8_2009.csv
    < 150 Opening BINARY mode data connection for 500108030000_TOD1_8_2009.csv.
    Data connection established with 166.109.4.90:1560 on 1/8/2009 @ 2:20:09 PM
    < 226-Maximum disk quota limited to 512000 kBytes
    <     Used disk quota 14852 kBytes, available 497147 kBytes
    < 226 Transfer complete.
    > QUIT
    Disconnected from 166.109.4.90:21 on 1/8/2009 @ 2:20:09 PM

    HERE the log file while throwing an error

    Connected to 166.109.4.90:21 on 1/8/2009 @ 2:20:24 PM
    < 220 Welcome to Southern Westchester BOCES – LHRIC -> Serv-U FTP Server v6.1 for WinSock ready…
    > USER iepduser
    < 331 User name okay, need password.
    > PASS XXXX
    < 230 User logged in, proceed.
    > TYPE I
    < 200 Type set to I.
    > PASV
    < 227 Entering Passive Mode (166,109,4,90,6,33)
    > STOR 661100010000_TOD1_8_2009.csv
    Data connection established with 166.109.4.90:1569 on 1/8/2009 @ 2:20:24 PM
    < 150 Opening BINARY mode data connection for 661100010000_TOD1_8_2009.csv.
    < 226-Maximum disk quota limited to 512000 kBytes
    <     Used disk quota 14916 kBytes, available 497083 kBytes
    < 226 Transfer complete.
    < 421 Connection timed out – closing.
    Disconnected from 166.109.4.90:21 on 1/8/2009 @ 2:30:26 PM
    Connected to 166.109.4.90:21 on 1/8/2009 @ 2:32:05 PM
    < 220 Welcome to Southern Westchester BOCES – LHRIC -> Serv-U FTP Server v6.1 for WinSock ready…
    > USER iepduser
    < 331 User name okay, need password.
    > PASS xxxxx
    < 230 User logged in, proceed.
    > TYPE I
    < 200 Type set to I.
    > PASV
    < 227 Entering Passive Mode (166,109,4,90,6,110)
    > STOR 661100010000_1_8_2009.csv
    Data connection established with 166.109.4.90:1646 on 1/8/2009 @ 2:32:05 PM
    < 150 Opening BINARY mode data connection for 661100010000_1_8_2009.csv.
    < 226-Maximum disk quota limited to 512000 kBytes
    <     Used disk quota 14931 kBytes, available 497068 kBytes
    < 226 Transfer complete.
    > QUIT
    Disconnected from 166.109.4.90:21 on 1/8/2009 @ 2:32:05 PM

    If you notice the second log, there was no QUIT command in that and connection gets timed out. You can check my code which was given earlier.

    Looking for your reply.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Rajkumar (had 794 views)

    User (Old forums)
    Member
    Post count: 23064

    The only thing we can see at this point is a synchronization problem between commands and responses in the sequences of commands.

    We are working on a new version that MAY resolve your issue.  However, we can’t guarantee it.  This version should be available sometime in february 2009.   We can only suggest you try it out when it becomes available.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by André (had 7785 views)

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