Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
9.1k views
in .NET FTP by (162k points)
Someone reported this message in an exception when connecting to an SFTP server recently.

It happened very early in the connection - just after the server version was reported in the log (SSH-2.0-OpenSSH_3.9p1).

It turned out that the failure was in parsing the version number, in particular this was (bizarrely) failing:

Int32.Parse("0")

How can this fail? Well, it turns out that this is a reported bug in regional settings for Windows - see

http://connect.microsoft.com/VisualStud ... kID=114942

Essentially, it happens when HKEY_CURRENT_USER\Control Panel\International\sPositiveSign registry value is corrupted (which seems to happen quite a bit).

It can be fixed simply by resetting the format in Control Panel. Go to Regional settings, and change the format to another country and then back again to your own. This resets the registry value to the correct one.

6 Answers

0 votes
by (280 points)
Does this solution apply to the following exception as well ? : 'EnterpriseDT.Net.Ftp.Ssh.SFTPException: Format of server version is invalid'.
0 votes
by (162k points)
No, I don't think so. Can you post a log file set to the All level?
0 votes
by (280 points)
Hope this helps..

DEBUG : Set LocalDirectory='C:\Program Files\Enterprise Distributed Technologies\edtFTPnet PRO'
INFO : Licence expiry date: 12/31/2099
INFO : Production license
INFO : Licence expiry date: 12/31/2099
INFO : Production license
DEBUG : 192.168.1.102 resolved to 192.168.1.102
DEBUG : Connecting directly to SFTP server 192.168.1.102:22
DEBUG : Connected successfully to SFTP server 192.168.1.102:22
DEBUG : Beginning protocol negotiation
DEBUG : Protocol negotiation complete
DEBUG : RepeatCallback received 27 bytes
DEBUG : offset=0,length=27
DEBUG : pos=26
ERROR : EnterpriseDT.Net.Ftp.Ssh.SFTPException: Format of server version is invalid : System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at ExampleViewer.NonGuiExPage.RunExample()
CAUSED BY:
EnterpriseDT.Net.Ftp.Ssh.SFTPException: Format of server version is invalid
at EnterpriseDT.Net.Ftp.Ssh.SSHFTPClient.Connect()
at EnterpriseDT.Net.Ftp.SecureFTPConnection.Connect()
at SFTP1Example.Run(String serverAddress, Int32 serverPort, String userName, String password)
CAUSED BY:
EnterpriseDT.Net.Ftp.Ssh.SFTPException: Format of server version is invalid
at EnterpriseDT.Net.Ftp.Ssh.SSHFTPClient.Connect()
at EnterpriseDT.Net.Ftp.SecureFTPConnection.Connect()
at SFTP1Example.Run(String serverAddress, Int32 serverPort, String userName, String password)
0 votes
by (162k points)
what version of the DLL are you using?
0 votes
by (280 points)
4.1.2.0
0 votes
by (162k points)
It is probably best to upgrade to the latest version 6.0.0.

Here's the change log - there's been dozens of bug fixes since your release.

http://www.enterprisedt.com/products/ed ... story.html

Categories

...