Timeout waiting for WinSCP to respond - XML Logging Issue

Advertisement

Cyberspy
Joined:
Posts:
3

Timeout waiting for WinSCP to respond - XML Logging Issue

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:
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:

    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:

[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:

[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!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Timeout waiting for WinSCP to respond - XML Logging Issue

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

Reply with quote

Cyberspy
Joined:
Posts:
3

Re: Timeout waiting for WinSCP to respond - XML Logging Issu

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

Reply with quote

Cyberspy
Joined:
Posts:
3

prikryl,

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

Same error though:

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
Description: Debug log file

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum