EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SFTP component not connected error

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#11676
Posted: 11/13/2009 23:56:23
by Ken Ivanov (EldoS Corp.)

Tim, can you please give us a bit more information:
1) which version of SecureBlackbox are you using (including the build number)?
2) does the problem *always* occur under the same circumstances or it is intermittent? In other words, do the same server and the same file being uploaded *always* cause the mentioned issue?

OnError is only used to report SSH/SFTP protocol errors. All the component errors are reported via exceptions. I.e., the exception you are encountering tells that there were no protocol errors, but the connection between peers have been closed for some reason.

If you are a registered customer, please assign the license ticket you received in the registration letter to your account to get Standard support level (this will allow us help you faster).
#11678
Posted: 11/14/2009 02:58:38
by Eugene Mayevski (EldoS Corp.)

Tim, if such exception happens in response to UploadFile command, this means that the server was dumb enough to not understand the command sent and even more dumb to not report the problem to the client, but silently close connection instead. Maybe, the authors have outsourced server development to some prehistoric tribe ...

The usual reasons for not understanding are:

1) Pipelining. Disable pipelining by setting PipelineLength property to 1 and AutoAdjustTransferBlock property to false.

2) wrong file path. Be sure that your path is absolute for the system you are connecting to. For Unix systems and most Windows servers this means that the path must start with slash (/). The path you've specified ("t00033edi:/TestFile.tst") is quite strange so I can't say for sure how the absolute path should look like. Try to put slash before the path.

3) (quite new but very interesting behavior) the version of SFTP being negotiated. If the server causes problems, try setting Versions property to SFTP3 only (numeric value 8): ElSimpleSFTPClient.Versions = SBSftpCommon.Unit.sbSFTP3;


Sincerely yours
Eugene Mayevski
#11679
Posted: 11/14/2009 04:54:22
by Eugene Mayevski (EldoS Corp.)

After looking at the log more attentively, I guess I know the reason. The buggy server gives you wrong folder name (which contains a colon). When you use this value, the server can't handle such folder name and just dies. Opensource, you know... So to fix the problem, try to modify the path as the very first remedy.


Sincerely yours
Eugene Mayevski
#11680
Posted: 11/15/2009 23:57:44
by Tim Molloy (Standard support level)
Joined: 11/13/2009
Posts: 21

Innokentiy,

I don't see where to assign the license ticket in my profile...
#11681
Posted: 11/16/2009 00:00:18
by Tim Molloy (Standard support level)
Joined: 11/13/2009
Posts: 21

I have tried modifying the path to ".\TestFile.tst" and I still get the same error.
#11682
Posted: 11/16/2009 00:02:21
by Tim Molloy (Standard support level)
Joined: 11/13/2009
Posts: 21

The unusual thing is, I'm hitting the exact same server, only with multiple login accounts and it works for 5 of them (always the same 5), but fails with this error for the remaining 15 (or so).

Are there other exceptions that I can trap to get more detail on this error?
#11683
Posted: 11/16/2009 00:06:07
by Eugene Mayevski (EldoS Corp.)

Quote
Tim Molloy wrote:
Innokentiy,

I don't see where to assign the license ticket in my profile...


Follow the instructions in the registration letter.

Quote
Tim Molloy wrote:
The unusual thing is, I'm hitting the exact same server, only with multiple login accounts and it works for 5 of them (always the same 5), but fails with this error for the remaining 15 (or so).


Then there exist only two possibilities:
1) You don't have permissions to write to the specified folder (for some of the accounts)
2) You do have an invalid path (or path which doesn't exist - neither SecureBlackbox nor server would create the path for you).


Sincerely yours
Eugene Mayevski
#11684
Posted: 11/16/2009 00:19:43
by Tim Molloy (Standard support level)
Joined: 11/13/2009
Posts: 21

GOOD NEWS, Eugene! The Pipelining adjustment didn't work and modifying the file path was incorrect too, but setting the Versions property did the trick! Thanks so much for your help!

However, I now have another question! :)

Setting the Date properties of the file is not working as expected. I am using the below code to set the updated timestamp on the uploaded file, but for some reason, it sets it for 7 hours ago...

Code
try
                {
                    // now adjust the attributes of the uploaded file
                    TElSftpFileAttributes attribs = new TElSftpFileAttributes();
                    attribs.CTime = DateTime.Now;
                    attribs.MTime = attribs.CTime;
                    attribs.ATime = attribs.CTime;
                    attribs.CATime = attribs.CTime;

                    attribs.IncludedAttributes = SBSftpCommon.__Global.saATime | SBSftpCommon.__Global.saMTime | SBSftpCommon.__Global.saCTime | SBSftpCommon.__Global.saCATime;
                    sftpClient.SetAttributes(remotePath, attribs);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(String.Format("Error when trying to change the attributes of the uploaded file: {0}", ex.Message));
                }
#11685
Posted: 11/16/2009 00:44:54
by Eugene Mayevski (EldoS Corp.)

You are setting local time, and time must be in UTC time zone.


Sincerely yours
Eugene Mayevski
#11686
Posted: 11/16/2009 01:32:39
by Tim Molloy (Standard support level)
Joined: 11/13/2009
Posts: 21

I'm not sure I understand...

Code
DateTime.Now


...is correctly setting the timestamp...

when I inspect the properties before SetAttributes() is called, it appears correct. But, when I look at the file uploaded using FileZilla, it has modified date of now - 7 hours.
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 17883 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!