Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Adrian_Saracila

Re: Error - "Element already read to the end " - winscpnet.dll

Thank you for your response!

Regards,
Adrian
martin

Re: Error - "Element already read to the end " - winscpnet.dll

A root cause of the problem is that your server terminates connection for some reason.
WinSCP .NET assembly does not properly detect that and on subsequent call to Session.FileExists (when session is closed already) fails with cryptic error.

Request to improve this was added to tracker:
https://winscp.net/tracker/1137
martin

Re: Error - "Element already read to the end " - winscpnet.dll

Please attach a full session and debug log files showing the problem (using the latest version of WinSCP).

To generate log files, set Session.SessionLogPath and Session.DebugLogPath. Submit the logs with your post as an attachment. You may want to remove data you consider sensitive, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.
Adrian_Saracila

Error - "Element already read to the end " - winscpnet.dll

Hi,

First of all, congratulations for your wonderful work with WinSCP!

I use winscpnet.dll in a SQL Server Integration Service package, in a Dataflow task, specifically in a Script Component (transformation component).
The protocol is FTP.
The DataFlow task downloads a variable number of files using this Script component (code similar with what you have for SSIS in samples).
The session is created/opened in PreExecute() and closed in PostExecute() methods of script component.
Multiple instances of the package can run simultaneously, downloading different files from the FTP server at the same time.

On production server we receive "Element already read to the end" errors from time to time. We have to retry the download for the files affected in a later package schedule run.
Maybe you have an idea what is the cause of these errors and how I can avoid these?

Thank you!
Regards,
Adrian