Home Forums .NET libraries Xceed SFTP/FTP for .NET Null ref in FtpFile.OpenWriteAlways

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

    We have a .Net 2.0 FTP client app deployed that uses Xceed FTP version 2.1.6113.0 and Xceed Filesystem version 2.3.6113.0. From time to time we get the following exception:

    Exception:
    MESSAGE: An error occurred while opening a file for writing.
    Type: Xceed.Ftp.FtpFile
    TRACE: at Xceed.FileSystem.FileSystemItem.CopyTo(FileSystemEvents events, Object userData, AbstractFolder destinationFolder, Boolean replaceExistingFiles)
    at Xceed.FileSystem.FileSystemItem.CopyTo(AbstractFolder destinationFolder, Boolean replaceExistingFiles)

    The inner exception is:
    MESSAGE: Object reference not set to an instance of an object.
    SOURCE: Xceed.Ftp
    TRACE: at Xceed.Ftp.Engine.FtpDataConsumerCommand.AcquireDataStream()
    at Xceed.Ftp.FtpClient.GetUploadStream(String remoteFilename, Boolean append)
    at Xceed.Ftp.FtpFile.OpenWriteAlways(Boolean overwrite, FileShare share)

    It’s only an occasional problem–most of the time this code runs flawlessly. I don’t know whether our users are experiencing connection problems when this occurs or not. It looks like the component is trying to open a data stream and not dealing gracefully with a failure; anything would be better than a null ref.

    There is no way for me to fix an error that occurs entirely within the Xceed dll’s, at least not without some more information. Right now I’m just catching it and doing the best I can to clean up. Has anyone seen this or solved it? Is this fixed in a newer version of the component? Any help will be greatly appreciated.

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

    User (Old forums)
    Member
    Post count: 23064

    We have never come across this error so far.

    You could try our latest version to see if the issue is resolved. You can download it <a href=”http://xceed.com/pages/TopMenu/Downloads/Updates.aspx?Lang=EN-CA”>here</a&gt;.

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

    User (Old forums)
    Member
    Post count: 23064

    I’m using Xceed FTP 3.4 (blueprint edition) and am having exactly the same problem.
    The problem does not occur randomly; however, the error message it throws does not always reflect the root cause.

    For example, when I try to upload a file, which is readonly on the FTP server, there are two possible
    error messages that Xceed FTP could throw. Please see below error log…

    [12:46:18][Warning]:Encounter error while processing /DRIVE_C/Test/testreadonly.txt
    [12:46:18][Warning]:Encountered Exception: System.NullReferenceException
    Message: Object reference not set to an instance of an object.
    StackTrace:
    at Xceed.Ftp.Engine.FtpDataConsumerCommand.AcquireDataStream(Int32 timeout) in C:\PRJ\F_XCEED\Xceed.Ftp.Blueprint\Engine\(Commands)\FtpDataConsumerCommand.cs:line 67
    at Xceed.Ftp.FtpClient.GetUploadStream(String remoteFilename, Boolean append) in C:\PRJ\F_XCEED\Xceed.Ftp.Blueprint\FtpClient.cs:line 2474
    at Febees.Utils.Net.FtpXceed.GetUploadStream(String pathname) in C:\PRJ\F_SML\SMLDev\Utils\Net\FtpXceed.cs:line 409
    at Febees.Backup.Core.FtpSerializerUtil.StartOpenFileStreamForWrite(FsItem item) in C:\PRJ\F_SML\SMLDev\Core\LocationSerializers\FtpSerializerUtil.cs:line 434
    at Febees.Backup.Core.FtpSerializerUtil.TransferItemTo(Item item, LocationSerializer targetSerializer) in C:\PRJ\F_SML\SMLDev\Core\LocationSerializers\FtpSerializerUtil.cs:line 172
    at Febees.Backup.Core.FileBackupJob.TransferItem(LocationSerializer sourceSerializer, LocationSerializer targetSerializer, Item sourceItem) in C:\PRJ\F_SML\SMLDev\Core\Jobs\FileBackupJob.cs:line 536
    at Febees.Backup.Core.FileBackupJob.ItemProc(Item item, LocationSerializer sourceSerializer, LocationSerializer targetSerializer) in C:\PRJ\F_SML\SMLDev\Core\Jobs\FileBackupJob.cs:line 489
    at Febees.Backup.Core.FileBackupJob.HandleItemProc(Item item, LocationSerializer sourceSerializer, LocationSerializer targetSerializer) in C:\PRJ\F_SML\SMLDev\Core\Jobs\FileBackupJob.cs:line 411
    [12:46:18][Warning]:Retrying 1 (max 3)…
    [12:46:18][Normal]:Transferrig: /DRIVE_C/Test/testreadonly.txt
    [12:46:18][Warning]:Encounter error while processing /DRIVE_C/Test/testreadonly.txt
    [12:46:18][Warning]:Encountered Exception: Xceed.Ftp.FtpReplyException
    Message: Permission denied (reply code 550)
    StackTrace:
    at Xceed.Ftp.Engine.FtpCommandSequence.EndExecute(IAsyncResult asyncResult) in C:\PRJ\F_XCEED\Xceed.Ftp.Blueprint\Engine\FtpCommandSequence.cs:line 141
    at Xceed.Ftp.FtpClient.GetUploadStream(String remoteFilename, Boolean append) in C:\PRJ\F_XCEED\Xceed.Ftp.Blueprint\FtpClient.cs:line 2474
    at Febees.Utils.Net.FtpXceed.GetUploadStream(String pathname) in C:\PRJ\F_SML\SMLDev\Utils\Net\FtpXceed.cs:line 409
    at Febees.Backup.Core.FtpSerializerUtil.StartOpenFileStreamForWrite(FsItem item) in C:\PRJ\F_SML\SMLDev\Core\LocationSerializers\FtpSerializerUtil.cs:line 434
    at Febees.Backup.Core.FtpSerializerUtil.TransferItemTo(Item item, LocationSerializer targetSerializer) in C:\PRJ\F_SML\SMLDev\Core\LocationSerializers\FtpSerializerUtil.cs:line 172
    at Febees.Backup.Core.FileBackupJob.TransferItem(LocationSerializer sourceSerializer, LocationSerializer targetSerializer, Item sourceItem) in C:\PRJ\F_SML\SMLDev\Core\Jobs\FileBackupJob.cs:line 536
    at Febees.Backup.Core.FileBackupJob.ItemProc(Item item, LocationSerializer sourceSerializer, LocationSerializer targetSerializer) in C:\PRJ\F_SML\SMLDev\Core\Jobs\FileBackupJob.cs:line 489
    at Febees.Backup.Core.FileBackupJob.HandleItemProc(Item item, LocationSerializer sourceSerializer, LocationSerializer targetSerializer) in C:\PRJ\F_SML\SMLDev\Core\Jobs\FileBackupJob.cs:line 411

    Any ideas?

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

    User (Old forums)
    Member
    Post count: 23064

    Could you set the TraceWriter property, so we can see the communication with the server? Can you provide the code snippet you are using?

    Would it be possible for us to get access to your server, so we can try to reproduce the issue? If so, you can send the connection information to <a href=”mailto:support@xceedsoft.com”>support</a>.

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

    User (Old forums)
    Member
    Post count: 23064

    Yes. I will start to prepare the requested items and will be back when I am done.

    Thanks!

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

    User (Old forums)
    Member
    Post count: 23064

    Just sent out the requested items; hopefully, you guys can reproduce the issue.

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

    User (Old forums)
    Member
    Post count: 23064

    We have reproduced the exception, and it is a bug caused by a “race condition” in the Dispose of the FtpAsyncResult.

    This will be corrected, but a time frame is not provided at this point. Watch this <a href=”http://xceed.com/pages/TopMenu/Downloads/Updates.aspx?Lang=EN-CA”>page</a&gt; to be notified when the fix becomes available.

    Unfortunately, there is not workaround in the meantime.

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

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