System.Exception: Server returned an error - WeOnlyDo Discussion board

System.Exception: Server returned an error (General questions)

by Yuval, Tuesday, May 03, 2005, 16:03 (7143 days ago)

I have a windows service (C#) which is periodically searching for files on a remote server – when it finds files that matched a certain naming convention it attempts to download the files.
When calling the GetFile method I get:
[code]
System.Exception: Server returned an error: End of file
at WeOnlyDo.Protocols.SFTP._GetFile()
at WeOnlyDo.Protocols.SFTP.GetFile(String LocalPath, String RemoteFile)
at WeOnlyDo.Client.SFTP.GetFile(String LocalPath, String RemoteFile)
[/code]
(I am able to connect to the server using WINSCP3 and download the files)

Any clue as to how to get around this issue?

Re: System.Exception: Server returned an error

by wodSupport, Tuesday, May 03, 2005, 16:10 (7143 days ago) @ Yuval

Yuval,

do you use full path when you access remote files, such as

/home/joe/folder/filename.ext

or you use relative? You must use full path at all times.

Re: System.Exception: Server returned an error

by sbowers, Thursday, June 30, 2005, 23:19 (7084 days ago) @ wodSupport

I am also having this problem and I am always using the full path for the remote file in my GetFile(<remotepath>, <localpath>) call. I know the file is being transferred correctly because it shows up in my local path. I've transferred binary files (like spreadsheets) and they open correctly after the get.

I just recently received an email from Kreso in technical support and he is leaning towards a bug with the wodSFTP against the SFTP server that I'm using. My server is WAC Manager 1.4 from Foxit Software. What are you using?

As a workaround, when I catch the exception thrown from GetFile (this only occurs when BlockingMode = TRUE), I interrogate the error code returned from GetServerErrorCode(). If it is > 1, it is still an error, otherwise, I assume success. An error code of 0 means OK and an error code of 1 means End of File .

Long term, I don't like it, but I'm awaiting a response from tech support.

Re: System.Exception: Server returned an error

by wodSupport, Thursday, June 30, 2005, 23:47 (7084 days ago) @ sbowers

Scott,

this is obviously a bug in WAC you're using. We just tried to download 400kb file, and it reported file size is 17966745847332863 - which is obviously incorrect. Since we tried to download that much, eventually it reached real end of the file and reported the error.

I think you should contact WAC support about this.