WinSCP process terminated with exit code 255 or 3

Advertisement

davida
Joined:
Posts:
3
Location:
UK

WinSCP process terminated with exit code 255 or 3

I have a SQL Server Integration Services package containing a Microsoft Visual C# 2008 script which uses the WinSCP .NET assembly to transfer files to a remote SFTP server. The package runs once a day and uploads two files each time.

WinSCP.exe is file version 5.5.1.3970, product version 5.5.1.0
WinSCPnet.dll is file version 1.1.4.3970, product version 5.5.1.0

Since Friday my SSIS package is failing with either of the following errors:

Message: Error when using WinSCP to upload files: WinSCP.SessionLocalException: WinSCP process terminated with exit code 255 and output "", without responding (response log file C:\Windows\TEMP\wscp4BF8.03CE0BB8.tmp was not created). This could indicate lack of write permissions to the log folder or problems starting WinSCP itself.
at WinSCP.Session.Open(SessionOptions sessionOptions)

Message: Error when using WinSCP to upload files: WinSCP.SessionLocalException: WinSCP process terminated with exit code 3 and output "", without responding (response log file C:\Windows\TEMP\wscp28E8.03CE0BB8.tmp was not created). This could indicate lack of write permissions to the log folder or problems starting WinSCP itself.
at WinSCP.Session.Open(SessionOptions sessionOptions)

I've inherited this config so not as familiar as I'd like, however I'm pretty sure my SSIS package runs as SYSTEM (it's configured to use the SQL Agent user, which in turn uses the Local System account), which does have full control over C:\Windows\TEMP, so I'm unsure why no log file is created.

This sounds a lot like https://winscp.net/tracker/996 but that was fixed at 5.2.5, which is an earlier release than the one I'm using, so I'm not certain it's the same issue.

Is there anything else I can provide or look at which may help identify the issue?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: WinSCP process terminated with exit code 255 or 3

Does system restart help? Can you update your version of WinSCP? The latest version may provide better diagnostics.

Reply with quote

davida
Joined:
Posts:
3
Location:
UK

Re: WinSCP process terminated with exit code 255 or 3

martin wrote:

Does system restart help? Can you update your version of WinSCP? The latest version may provide better diagnostics.

Thanks for getting back to me and sorry for the delay replying! The server isn't under my control so I suggested a reboot, however before it could be planned the issue went away. The job has been working successfully for over a week so I suspect the problem was at the remote end rather than with the job or with WinSCP itself.

Reply with quote

davida
Joined:
Posts:
3
Location:
UK

Problem has recurred recently

So the problem went away for several months but has now come back.

To try and diagnose the issue I have upgraded to 5.13.3. I've added in debug logging to the script and this seems to just confirm the same error as shown in the SQL Agent history:

[2018-08-22 15:30:11.925Z] [0003]   ExeSessionProcess.GetExecutablePath entering
[2018-08-22 15:30:11.926Z] [0003]   ExeSessionProcess.GetExecutablePath leaving
[2018-08-22 15:30:11.926Z] [0003]   C:\Program Files (x86)\WinSCP\winscp.exe - exists [True]
[2018-08-22 15:30:11.927Z] [0003]   Exception: WinSCP.SessionLocalException: WinSCP process terminated with exit code 3. There was no output. Response log file C:\Windows\TEMP\wscp8070.03CE0BB8.tmp was not created. This could indicate lack of write permissions to the log folder or problems starting WinSCP itself.
[2018-08-22 15:30:11.927Z] [0003]      at WinSCP.Logger.WriteException(Exception e)
   at WinSCP.Session.Open(SessionOptions sessionOptions)
   at ST_1c89ecdbbd4e4d9180fa9644226a0966.csproj.ScriptMain.Main()
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle 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 Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
   at Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptTask.Execute(Connections connections, VariableDispenser variableDispenser, IDTSComponentEvents events, IDTSLogging log, Object transaction)
   at Microsoft.SqlServer.Dts.Runtime.ManagedWrapper.Execute(IDTSConnections100 connections, IDTSVariableDispenser100 variableDispenser, IDTSComponentEvents100 componentEvents, IDTSLogging100 log, Object transaction)

[2018-08-22 15:30:11.929Z] [0003]   Exception: WinSCP.SessionLocalException: WinSCP process terminated with exit code 3. There was no output. Response log file C:\Windows\TEMP\wscp8070.03CE0BB8.tmp was not created. This could indicate lack of write permissions to the log folder or problems starting WinSCP itself.
   at WinSCP.Session.Open(SessionOptions sessionOptions)
[2018-08-22 15:30:11.934Z] [0003]   Session.Cleanup entering
[2018-08-22 15:30:11.934Z] [0003]     Terminating process

Additionally there are two unusual aspects to the issue:

1. When I run the SSIS package in debug mode within Business Intelligence Design Studio, the WinSCP process executes successfully
2. On 21 August the SQL Agent task was successful, but it failed on 22 August, however it has been failing consistently for a few weeks now

The server has not yet been rebooted so I appreciate that may be the next step but I wondered if anyone had any further ideas as to what the problem might be.

Reply with quote

martin
Site Admin
martin avatar

Re: Problem has recurred recently

Please do try the restart to see if the problem is intermittent or permanent.

Reply with quote

Advertisement

You can post new topics in this forum