Re: Same error
@eduard.torres10: That's not an error. Please post the actual error. Or even better a complete log file.
open sftp://Sftp_Prod:***@10.2**.1**.1*:22 -hostkey="*" -timeout=15
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Sftp,
HostName = "************",
UserName = "atzzz001",
Password = "******",
SshHostKeyFingerprint = "********************",
Timeout = TimeSpan.FromSeconds(120)
};
Updating Clients Linking information from Database LAANDWDB01 - 11/1/2021 10:30:01 PM
Synchronizing Latest Axiom Update Data
Error: System.TimeoutException: Timeout waiting for WinSCP to respond - WinSCP has not responded in time. There was no output. Response log file E:\AxiomAutoCheck2\log\winscp.log was not created. This could indicate lack of write permissions to the log folder or problems starting WinSCP itself.
at WinSCP.Session.CheckForTimeout(String additional)
at WinSCP.Session.Open(SessionOptions sessionOptions)
at AxiomLogs2DB.AxiomLogs2DB.downloadNewDataFiles()
Writing Latest Axiom Data Files to Database - 11/1/2021 10:31:32 PM
session.Open
regardless of how I set the timeout value
I supplied the user credentials, but now I am gettingWin32_exception The stub received bad data error
Googling suggest the process domain is not specified, but I don't see a way to set that.
session.ExecutableProcessUserName = "user@domain";
Log Linked Files Archive - Started - 10/31/2021 2:20:14 AM
Error: System.TimeoutException: Timeout waiting for WinSCP to respond - WinSCP has not responded in time. There was no output. Response log file E:\AbacusAutoCheck2\log\winscp.log was not created. This could indicate lack of write permissions to the log folder or problems starting WinSCP itself.
at WinSCP.Session.CheckForTimeout(String additional)
at WinSCP.Session.Open(SessionOptions sessionOptions)
at AbacusLogs2DB.AbacusLogs2DB.LogLinkedFilesArchive()
Log Linked Files Archive - Finished - 10/31/2021 2:21:21 AM
Win32_exception The stub received bad data error.
RemoteDirectoryInfo directory = session.ListDirectory("/data");
E:\Taxies\sFTPSessionLog.txt
Session.open(SessionOptions)
is throwing a "Timeout waiting for WinSCP to respond." error when executed in our production server.
[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
DisableVersionCheck
? Looks suspicious.
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);
Session.DegugLogPath
I received the error
Object reference not set to an instance of an object
Session.Open
command.
Session.DebugLogPath
and post or email me the log.
session.Open(sessionOptions)
, after a long time I get "Time out". Do you have any idea about this waiting time on Session.Open
?