Topic "Time-Out on session.open"

Author Message
paulo_oli
[View user's profile]

Joined: 2012-04-13
Posts: 4
Location: So Paulo - Brazil
Hi Everybody.
I'm using the component for first time.
I copied the c# example in my class and passed the parameters. When pass by session.Open(sessionOptions), after a long time I get "Time out". Do you have any idea about this waiting time on session.open?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Please set Session.DebugLogPath and post or email me the log.
_________________
Martin Prikryl
paulo_oli
[View user's profile]

Joined: 2012-04-13
Posts: 4
Location: So Paulo - Brazil
Hi prikryl, how is it going?
After I set Session.DegugLogPath I received the error "Object reference not set to an instance of an object" in session.open command.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
paulo_oli wrote:
Hi prikryl, how is it going?
After I set Session.DegugLogPath I received the error "Object reference not set to an instance of an object" in session.open command.

Please post sample of the code.
_________________
Martin Prikryl
paulo_oli
[View user's profile]

Joined: 2012-04-13
Posts: 4
Location: So Paulo - Brazil
prikryl wrote:
paulo_oli wrote:
Hi prikryl, how is it going?
After I set Session.DegugLogPath I received the error "Object reference not set to an instance of an object" in session.open command.

Please post sample of the code.



using (Session session = new Session())
{
// Connect
session.DisableVersionCheck = true;
session.Timeout = new TimeSpan(0, 2, 0);
session.SessionLogPath = @"C:\TEMP\logWinSCP";
session.ExecutablePath = @"C:\Projetos\tools\WinSCP\WinSCP.exe";
session.IniFilePath = @"C:\Projetos\tools\WinSCP\WinSCP.ini";

session.DebugLogPath = @"C:\TEMP\logWinSCP";
session.Open(sessionOptions);
paulo_oli
[View user's profile]

Joined: 2012-04-13
Posts: 4
Location: So Paulo - Brazil
Whole method until this point:

SessionOptions sessionOptions = new SessionOptions {
Protocol = Protocol.Sftp,
HostName = ConfigurationSettings.AppSettings["Host"],
UserName = ConfigurationSettings.AppSettings["UserName"] ,
Password = ConfigurationSettings.AppSettings["Pass"] ,
SshHostKey = ConfigurationSettings.AppSettings["HostKey"]
};

using (Session session = new Session())
{
// Connect
session.DisableVersionCheck = true;
session.Timeout = new TimeSpan(0, 2, 0);
session.SessionLogPath = @"C:\TEMP\logWinSCP";
session.ExecutablePath = @"C:\Projetos\tools\WinSCP\WinSCP.exe";
session.IniFilePath = @"C:\Projetos\tools\WinSCP\WinSCP.ini";

session.DebugLogPath = @"C:\TEMP\logWinSCP";
session.Open(sessionOptions);
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
First, why are you setting DisableVersionCheck? Looks suspicious.

Also, please post a callstack of the exception you are getting. I'm not getting it with your code.
_________________
Martin Prikryl
cpvl
[View user's profile]

Joined: 2012-06-13
Posts: 5
did you figure out how come winscp was timing out?
reachkars
[View user's profile]

Joined: 2012-08-30
Posts: 2
Location: US - New Jersey
The Session.open(SessionOptions) is throwing a Timeout waiting for WinSCP to respond." error when executed in our production server.

The same code works perfectly fine in our Development and local servers.

However, we are able to manually execute the WinSCP.exe GUI and connect to the FTP server in our prod server

Kindly advise if there is anypermission related settings we need to consider.

Following is the DebugLog

[2012-08-30 17:32:37Z] [0003] Executing Assembly: WinSCP, Version=1.0.0.528, Culture=neutral, PublicKeyToken=b5f19f5762436b89; Path: E:\inetpub\wwwroot\FinancialReporting.IF.wsTaxIESCrystal\bin\WinSCP.DLL; Location: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\wstaxiescrystal\5c47b0c9\7096f1a3\assembly\dl3\e2b55733\00378d1d_ca48cd01\WinSCP.DLL; Product: 5.0.7.0
[2012-08-30 17:32:37Z] [0003] Entry Assembly:
[2012-08-30 17:32:37Z] [0003] Operating system: Microsoft Windows NT 5.2.3790 Service Pack 2
[2012-08-30 17:32:37Z] [0003] User: TaxiESSVC_QA@AMRS@MPHEW2NCSV011; Interactive: False
[2012-08-30 17:32:37Z] [0003] Runtime: 2.0.50727.3625
[2012-08-30 17:32:37Z] [0003] Console encoding: Input: Western European (Windows) (1252); Output: Western European (Windows) (1252)
[2012-08-30 17:32:37Z] [0003] CallstackAndLock..ctor entering
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess..ctor entering
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.GetExecutablePath entering
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.GetExecutablePath leaving
[2012-08-30 17:32:37Z] [0003] EXE executable path resolved to E:\inetpub\wwwroot\***\bin\WinSCP.exe
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.CheckVersion entering
[2012-08-30 17:32:37Z] [0003] Version of E:\inetpub\wwwroot\***\bin\WinSCP.exe is 5.0.7.2268, product WinSCP version is 5.0.7.0
[2012-08-30 17:32:37Z] [0003] Version check disabled (not recommended)
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.CheckVersion leaving
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess..ctor leaving
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.Start entering
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.InitializeConsole entering
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.InitializeConsole leaving
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.InitializeChild entering
[2012-08-30 17:32:37Z] [0003] Starting "E:\inetpub\wwwroot\***\bin\WinSCP.exe" /xmllog="C:\WINDOWS\TEMP\tmp1453.tmp" /xmlgroups /nointeractiveinput /dotnet=507 /ini=nul /log="E:\Taxies\sFTPSessionLog.txt" /console /consoleinstance=_6296_695
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.InitializeChild leaving
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.Start leaving
[2012-08-30 17:32:37Z] [0003] Command: [option batch on]
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.ExecuteCommand entering
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.ExecuteCommand leaving
[2012-08-30 17:32:37Z] [0003] Command: [option confirm off]
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.ExecuteCommand entering
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.ExecuteCommand leaving
[2012-08-30 17:32:37Z] [0003] Session.SessionOptionsToOpenArguments entering
[2012-08-30 17:32:37Z] [0003] Session.SessionOptionsToOpenSwitches entering
[2012-08-30 17:32:37Z] [0003] Session.SessionOptionsToOpenSwitches leaving
[2012-08-30 17:32:37Z] [0003] Session.SessionOptionsToOpenArguments leaving
[2012-08-30 17:32:37Z] [0003] Command: [open -hostkey="ssh-rsa 2048 0f:e4:9b:98:e6:af:85:4c:97:c0:fa:c8:4d:14:76:76" -timeout=60 "sftp://***:***@*****.com"]
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.ExecuteCommand entering
[2012-08-30 17:32:37Z] [0003] ExeSessionProcess.ExecuteCommand leaving
[2012-08-30 17:32:37Z] [0009] ExeSessionProcess.ProcessEvents entering
[2012-08-30 17:33:37Z] [0003] Exception: System.TimeoutException: Timeout waiting for WinSCP to respond.
at WinSCP.Session.CheckForTimeout()
at WinSCP.Session.Open(SessionOptions sessionOptions)
[2012-08-30 17:33:37Z] [0003] Session.Cleanup entering
[2012-08-30 17:33:37Z] [0003] Command: [exit]
[2012-08-30 17:33:37Z] [0003] ExeSessionProcess.ExecuteCommand entering
[2012-08-30 17:33:37Z] [0003] ExeSessionProcess.ExecuteCommand leaving
[2012-08-30 17:33:37Z] [0003] ExeSessionProcess.Close entering
[2012-08-30 17:33:39Z] [0003] ExeSessionProcess.Close leaving
[2012-08-30 17:33:39Z] [0003] ExeSessionProcess.Dispose entering
[2012-08-30 17:33:39Z] [0009] ExeSessionProcess.ProcessEvents leaving
[2012-08-30 17:33:39Z] [0003] ExeSessionProcess.Dispose leaving
[2012-08-30 17:33:39Z] [0003] Session.Cleanup leaving
[2012-08-30 17:33:39Z] [0003] CallstackAndLock..ctor leaving
[2012-08-30 17:33:39Z] [0003] CallstackAndLock..ctor entering
[2012-08-30 17:33:39Z] [0003] Session.DoDispose entering
[2012-08-30 17:33:39Z] [0003] Session.Cleanup entering
[2012-08-30 17:33:39Z] [0003] Session.Cleanup leaving


Thanks,
Karthik
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Please attach also E:\Taxies\sFTPSessionLog.txt
_________________
Martin Prikryl
reachkars
[View user's profile]

Joined: 2012-08-30
Posts: 2
Location: US - New Jersey
It din get created
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
I have sent you an email with a debug version of WinSCP to address you have used to register on this forum.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License