EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SFTP Download failing

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
#17280
Posted: 08/15/2011 14:43:58
by Kelly Schoenhofen (Standard support level)
Joined: 08/05/2011
Posts: 4

I'm getting "Permission denied, error code 3" when I try to download a text file from a remote server. It creates a blank file locally but there's no content in it. Here's the full stacktrace -


StackTrace " at SBSftp.TElSftpClient.OpenFileSync(String Filename, Int32 Modes, TElSftpFileAttributes Attributes)\r\n at SBSimpleSftp.TElSimpleSFTPClient.OpenFile(String Filename, Int32 Modes, TElSftpFileAttributes Attributes)\r\n at SBSimpleSftp.TElSimpleSFTPClient.DownloadStream(String RemoteFileName, Stream LocalStream, TSBFileTransferMode Mode, Int64 RestartFrom)\r\n at SBSimpleSftp.TElSimpleSFTPClient.DownloadFile(String RemoteFileName, String LocalFileName, TSBFileTransferMode Mode, Int64 RestartFrom)\r\n at SBSimpleSftp.TElSimpleSFTPClient.DownloadFile(String RemoteFileName, String LocalFileName, TSBFileTransferMode Mode)\r\n at ClientFileManipulator.SFTP.Download(String actionID, String sourceDir, String sourceName, String destDir, String destName, Boolean deleteSource, Boolean wildcardSource) in C:\\Projects\\Source\\Tools\\xx\\xx\\SFTP.cs:line 143" string


Any ideas? I keep simplying everything I can (running it as myself, setting the destination folder to C:\Temp, etc.). I don't see how I don't have enough permissions to put data in a file I created 1 ms before.
#17281
Posted: 08/15/2011 15:15:47
by Eugene Mayevski (EldoS Corp.)

First thing to check is the exception class. OpenFileSync is the place where remote file is opened. And the error code might be reported by the server - you might have no access to the file you want to download. Why? Incorrect path to the file is a probable reason. SFTP uses absolute paths (starting with slash that denotes a root directory) and if you pass anything else, you will have problems of various kinds.


Sincerely yours
Eugene Mayevski
#17282
Posted: 08/15/2011 15:28:10
by Kelly Schoenhofen (Standard support level)
Joined: 08/05/2011
Posts: 4

I'll try with another client in a few minutes. We're transitioning from a different product to the Eldos SBB SDK, and I'm using the same account, so I _assumed_ I had sufficient permissions.

This should be a wildcard download, so if I say XX*.txt the local file created is the correct name - XX.2008.08.15.txt - so I know it's getting far enough to read the file name at least on the remote server, then create the file locally.

I've since backed off and gone back to DownloadFile(), to eliminate complexity.
#17283
Posted: 08/15/2011 15:30:22
by Kelly Schoenhofen (Standard support level)
Joined: 08/05/2011
Posts: 4

And I thought I had investigated the exception class thoroughly - that's where I got the stack trace. The exception.message is the "access denied error code 3", the trace is in my first email in this thread. Can you give me some more clues on what I'm looking for?
#17284
Posted: 08/15/2011 15:56:58
by Kelly Schoenhofen (Standard support level)
Joined: 08/05/2011
Posts: 4

Tried the transfer with another client - it worked just fine. I'm not worried there is something wrong with SecureBlackBox - I'm sure I am doing something wrong, but I can't see what. We've successfully implemented FTPS uploads and downloads with SBB, now we're extending it to SFTP. Uploads in SFTP work fine, it's just downloads that are failing.
#17290
Posted: 08/16/2011 00:54:41
by Eugene Mayevski (EldoS Corp.)

Exception class is the class name of the exception object. But this is not relevant now: this is SFTP error reported by the server. Unfortunately it's not clear what the server doesn't like as the file is opened just for reading (SBSftpCommon.fmRead attribute), so we have to pass the trial and error procedure to find out what the server doesn't like. I'll move your question to helpdesk.


Sincerely yours
Eugene Mayevski
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.

Reply

Statistics

Topic viewed 4245 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!