Topic "Timeout waiting for WinSCP to respond - XML Logging Issue"

Author Message
Cyberspy
[View user's profile]

Joined: 2012-11-01
Posts: 3
I'm trying to run WinSCP from a classic ASP page.

The script I am using works fine when I run it in a .wsf file, but fails when run under ASP (both using JavaScript)

The error message is:
Quote:
Timeout waiting for WinSCP to respond - Log file C:\Windows\TEMP\tmp910.tmp was not created in time, please make sure WinSCP has write permissions to the folder


I have given 'Everyone' Read/Write & Modify rights to the C:\Windows\TEMP folder, but this has not fixed the issue.
I've also exported all the WinSCP settings to a .ini file, and changed all the file locations where logs may be written to to a location which is writable by the web server account, but it stile uses the Windows\TEMP folder

I also tried setting these two INI settings from my script:

Code:
    sessionOptions.AddRawSettings("LogFileName", "D:%5Clogfolder%5C!S.log");
    sessionOptions.AddRawSettings("ActionsLogFileName", "D:%5Clogfolder%5C!S.xml");


but the error message stays the same - the path it is trying to write to is still C:\Windows\TEMP.

I also added a DebugLogPath to the Sesion, and found the following lines in the debug log:

Code:

[2012-11-01 12:42:52.615Z] [0001]     Session.GetTempPath entering
[2012-11-01 12:42:52.615Z] [0001]       Temporary folder: C:\Windows\TEMP\
[2012-11-01 12:42:52.615Z] [0001]       Temporary file: C:\Windows\TEMP\tmp910.tmp - Exists [True]
[2012-11-01 12:42:52.616Z] [0001]     Session.GetTempPath leaving
<snip />
[2012-11-01 12:42:52.626Z] [0001]         Starting "C:\Program Files (x86)\WinSCP\winscp.exe" /xmllog="C:\Windows\TEMP\tmp910.tmp" /xmlgroups /nointeractiveinput /dotnet=510 /ini=nul /log="D:\Projects\FMAG\trunk\files\Tesco\logasp.txt"  /console /consoleinstance=_7488_406


I can see the app goes and finds the Windows TEMP folder, looks to see if a Temp file exists (as far as I'm aware, it does not - I've never seen any of WinSCP's temp files appear in this folder) but it seems happy with it.

A few lines later, it uses this path and file name with the /xmllog switch in the command line it uses to call the main winscp.exe file.

A few more lines later, it throws an exception:

Code:
[2012-11-01 12:43:53.738Z] [0001]   Error [System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TimeoutException: Timeout waiting for WinSCP to respond - Log file C:\Windows\TEMP\tmp910.tmp was not created in time, please make sure WinSCP has write permissions to the folder
   at WinSCP.Session.CheckForTimeout(String additional)
   at WinSCP.Session.Open(SessionOptions sessionOptions)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at WinSCP.Session.System.Reflection.IReflect.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)]


So, my question is:
How can I turn off xmllogging entirely when using the COM object, or at least pick the location where the file is saved (perhaps through the AddRawSettings method)

Thanks for any help here!
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
You cannot turn off XML logging, it is required for the assembly to work.
You apparently have a write access to the folder (Temporary file: C:\Windows\TEMP\tmp910.tmp - Exists [True]). So changing the location won't help.
So the problem is rather that winscp.exe is not started for some reason at all.

Last edited by martin on 2012-11-08; edited 1 time in total
Cyberspy
[View user's profile]

Joined: 2012-11-01
Posts: 3
That might just be it - the account ASP is running under may not have access to run the .exe.
I'll try it tomorrow.

Thanks
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Please let me know.
_________________
Martin Prikryl
Cyberspy
[View user's profile]

Joined: 2012-11-01
Posts: 3
prikryl,

Just tried it - gave 'Everyone' Modify rights to the WinSCP folder and all files contained within.

Same error though:

Quote:
Timeout waiting for WinSCP to respond - Log file C:\Windows\TEMP\tmp6356.tmp was not created in time, please make sure WinSCP has write permissions to the folder


I've attached a copy of the Debugging Log File, in case it is of any use to you.

Regards

Adam
logaspdb.txt (7.58 KB) [Download]

Description: Debug log file

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Try setting Session.Timeout to more than default 1 second.
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