SFTP Connection Failure - WeOnlyDo Discussion board

SFTP Connection Failure (wodSFTP / wodSFTP.NET / wodSFTPdll)

by MikeG, Tuesday, October 28, 2008, 11:56 (5669 days ago)

Hi,

While connecting to one of our clients SFTP server we sometimes get the following ProtocolException:

Server identification string too long (more than 1024 bytes, possibly invalid)

We are trying to understand why this is occuring to tell the client what the problem is. FileZilla works very well with that SFTP site and not once had an issue.

Thank you

Mike

Re: SFTP Connection Failure

by woddrazen, Tuesday, October 28, 2008, 12:08 (5669 days ago) @ MikeG

Hi Mike,


Is there any chance we can duplicate this issue somehow?

Maybe we could connect there and duplicate your issue and see why it occur. Is this possible?

You can send your private information to techsupport@weonlydo.com


Regards,
Drazen

Re: SFTP Connection Failure

by MikeG, Tuesday, October 28, 2008, 12:25 (5669 days ago) @ woddrazen

Hi,

Unfortunately, I'm not allowed to give you security credentials to connect to that SFTP site. Like I said, the server belongs to the client. I just wanted to know under what circumstances this error message occurs. It doesn't seem to be a documented behaviour.

The client is upset because of our delay in connecting to their server and they don't understand what the problem is. We are supposed to connect and upload data to their site every 15 minutes and sometimes it takes a whole hour until we successfully connect.

I need to know if this is a bug in the FtpDLX.NET component or if it's really a protocol error. If it is a protocol error, I need to see it documented to prove to the client what the problem is.

Thank you

Re: SFTP Connection Failure

by woddrazen, Tuesday, October 28, 2008, 13:01 (5669 days ago) @ MikeG

Mike,


Can you please go to command prompt and type:

telnet your.hostname 22

and send us what is returned.


Drazen

Re: SFTP Connection Failure

by MikeG, Tuesday, October 28, 2008, 13:37 (5668 days ago) @ woddrazen

Hi Drazen,

I get the following two lines of text (I quoted them):
SSH-2.0-Connect:Enterprise_UNIX_2.4.01

I tried this several times, I always get the same message. It did time out a couple of times though (without a message).
Anything else you want me to try?

Thanks

Mike

Re: SFTP Connection Failure

by woddrazen, Tuesday, October 28, 2008, 15:04 (5668 days ago) @ MikeG

Mike,


Can you please add DebugFile Property to your code and send us output when you try to connect to that server?

Here is example how to add DebugFile to your code:
[code]dlx1.DebugFile = c:\debug.txt
dlx1.Connect()[/code]
Can you please confirm that you using SFTP protocol is wodFtpDLX.NET and port 22?


Drazen

Re: SFTP Connection Failure

by MikeG, Wednesday, October 29, 2008, 10:48 (5668 days ago) @ woddrazen

Hi Drazen,

Yes, we are using the SFTP protocol (SSH) under port 22.

It seems that the client made some changes to their server configuration and the job isn't failing anymore. I don't know what they did and if it's only a temporary fix. If it fails again, I'll run the connection with a debug log and let you know.

Thanks very much

Mike

Re: SFTP Connection Failure

by MikeG, Thursday, November 06, 2008, 11:02 (5660 days ago) @ MikeG

Hi Drazen,

I had the error again today (just once). But the SFTP connections does not log anything in the file.

I tested an FTP connection with a debug file and it logs a lot of stuff, but when I tested the SFTP and it doesn't log anything.

Any other ideas?
Do you know what validation rule fails?

Thanks

Mike

Re: SFTP Connection Failure

by wodDamir, Thursday, November 06, 2008, 11:14 (5660 days ago) @ MikeG

Mike,

What version of the component are you using? Can you please check what Version property returns?

Are you still experiencing the same error ( Server identification string too long)?

Regards,
Damba

Re: SFTP Connection Failure

by MikeG, Thursday, November 06, 2008, 12:58 (5660 days ago) @ wodDamir

Hi Damba,

I am using version 1.4.1.127. I was using the same version when I initially reported the problem. I know that version 1.4.2 was just released (I downloaded it an hour ago), but the release notes don't include any mention of this problem.

I am not experiencing the problem at the moment, it only happened once this morning (before I got to work). But there was nothing in the SFTP log.

I only want to know why this happens and if it's a bug or a server issue. If it is a server issue, can you explain this so that my client can understand it and correct it?

Regards

Mike

Re: SFTP Connection Failure

by wodDamir, Thursday, November 06, 2008, 13:37 (5659 days ago) @ MikeG

Mike,

I honestly can't tell at the moment, without duplicating the problem.

Can you please re-check what telnet your_server 22 returns?

In the previous check you posted in previous reply, there are two lines of the server greeting? Or is that a mistake in c/p?

Regards,
Damba

Re: SFTP Connection Failure

by MikeG, Thursday, November 06, 2008, 13:57 (5659 days ago) @ wodDamir

Damba,

It's not a mistake, there are two lines. Both lines are the same length. You can't see it in the post because muliple spaces are being removed in HTML.

Basically, the first line is SSH-2.0-Connect:Enterprise_UNIX_2.4.01
and the second line is all spaces, same length as the first.

Re: SFTP Connection Failure

by wodDamir, Thursday, November 06, 2008, 14:30 (5659 days ago) @ MikeG

Mike,

Could you please provide us with access to that server? I believe this could be server specific problem which we would have to duplicate.

Is there any chance you could perhaps setup a test account on that server?

I tried searching for server that would return the same identification string, but was unable to find one.

Regards,
Damba

Re: SFTP Connection Failure

by MikeG, Thursday, November 06, 2008, 14:54 (5659 days ago) @ wodDamir

Sorry, Damba. The client uses that SFTP server for automated processing of sensitive data. I really doubt that they would give you access to it.

Please note that I was only able to run telnet when FtpDLX did not experience these issues while connecting. My only hope is to catch the server when it's doing this and quickly run telnet. So far I didn't have the chance.

I get the complaints from the client's Project Manager and when I say that it's probably because of the SFTP server, the IT team ask me for a proof that the server isn't working. I give them that message and they tell me that it's not a standard message and there's nothing wrong with their server: it must be the component that we are using.

This is my dillema: since the message isn't standard and it's generated by your component, there must be a validation rule inside FtpDLX that makes a connection fail with that message. Is this rule documented anywhere? If this is not a standard documented behaviour, then I (and my client) can only assume that it's a bug.

Re: SFTP Connection Failure

by wodDamir, Thursday, November 06, 2008, 15:56 (5659 days ago) @ MikeG

Mike,

This error is thrown when the server identification string is too long (longer then 1024).

Could you perhaps dump the exact identification string (it needs to be long exactly as on your server) into a file and send it to us on techsupport@weonlydo.com ?

Perhaps we could set our server to match yours in order to duplicate the same behaviour.

Regards,
Damba

Re: SFTP Connection Failure

by MikeG, Thursday, November 06, 2008, 16:43 (5659 days ago) @ wodDamir

I was sort of expecting that might be the reason, but is it documented in the SFTP standard?

In other words, where exactly does it say that an SFTP server identification string is not allowed to be more that 1024 characters long? Because they are arguing that it is not a standard validation.

Thanks

Mike

Re: SFTP Connection Failure

by woddrazen, Thursday, November 06, 2008, 19:34 (5659 days ago) @ MikeG

Mike,


Honestly we will need to test this. We don't need to connect to that server we need only Hostname value.


Drazen

Re: SFTP Connection Failure

by Adi, Friday, February 12, 2010, 13:47 (5196 days ago) @ woddrazen

Mike,


Honestly we will need to test this. We don't need to connect to that server we need only Hostname value.


Drazen

Hi everyone,
Were you guys able to figure this out?

I'm experiencing the same problem.
I was able to identify where this exception comes from:

int index = this..();
int num4 = 0;
for (int i = 0; (i < this..()) && (num4 == 0); i++)
{
if (this.. == 10)
{
num4 = i;
}
}
if (num4 == 0)
{
if (this..() < 0x400)
{
return 0;
}
base. = new ProtocolException( Server identification string too long (more than 1024 bytes, possibly invalid) );
if (base. != null)
{
base..Set();
}
throw base.;
}

Can you guys tell me how that length is being determined?
internal int ()
{
return (this. - this.);
}
What is the meaning of the two instance variables?

Thank you in advance!

Re: SFTP Connection Failure

by woddrazen, Friday, February 12, 2010, 14:00 (5196 days ago) @ Adi

Hi Adi,


Which component you are using and which version? You can check version using component Version Property.

I think we fix that issue and it should be not received with latest version.

Let us know how it goes.


Regards,
Drazen

Re: SFTP Connection Failure

by Adi, Friday, February 12, 2010, 14:28 (5196 days ago) @ woddrazen

Hi Adi,


Which component you are using and which version? You can check version using component Version Property.

I think we fix that issue and it should be not received with latest version.

Let us know how it goes.


Regards,
Drazen

Hi Drazen,
Thank you for the quick reply. We're looking at Secure Ftp DELUXE (FtpDLX.NET) Client Component (WeOnlyDo.Client.FTP.dll), and the version is 1.4.3.133. Which is the version that has this issue fixed? What was causing the issue?

Re: SFTP Connection Failure

by woddrazen, Friday, February 12, 2010, 16:04 (5196 days ago) @ Adi

Adi,


Can you maybe test latest 1.5.0 version of wodFtpDLX.NET and see what happens?

If problem persist is there any chance we can duplicate it? This ticket was for our other component wodSFTP. So I'm not sure if this issue is fixed in wodFtpDLX.NET.

Also maybe this is not same issue.


Drazen

Re: SFTP Connection Failure

by Werner Mirz, Thursday, April 22, 2010, 11:10 (5128 days ago) @ woddrazen

Hi!

I have the same problem with one of pour customers. He changes his servers and with the new ones we get the server identification too long
error. In the SSH-specification it says: The maximum length of the
string is 255 characters, including the Carriage Return and Line Feed.
With 255*8 bit I get a maximum of 2040 bytes. Maybe the 1024 bytes in
your component is just to small?
We use Version 1.5.1.175 of wodftpdlx.net

Regards

Werner

Re: SFTP Connection Failure

by Werner, Thursday, April 22, 2010, 11:21 (5128 days ago) @ Werner Mirz

Oh... I mixed bits and bytes...what a shame....

Re: SFTP Connection Failure

by wodDamir, Thursday, April 22, 2010, 11:22 (5128 days ago) @ Werner

Hi Werner,

What server are you connecting to?

Also, 255*8 bits = 2040 bits (not bytes). Each character takes 1 byte (ASCII encoding).

Regards,
Damba

Re: SFTP Connection Failure

by Werner, Monday, April 26, 2010, 17:10 (5123 days ago) @ wodDamir

Hi

our problem is solved.
The connection has failed because the firewall of our customer blocked
my computer. After my adress has been entered in the firewall rules
there was no problem to get a connection.

I think an errormessage was used as identification string.
As I dont know what message has been sent (of even if any has been sent at all)
I can't tell details.

Werner