Topic "WinSCP 5.8.2 automation error"

Author Message
Lukas Filim

Guest


Hi Support,

I'm using latest version 5.8.2 with SFTP protocol on Windows Server 2008 R2.
I'm getting an error :
<failure>
<message>Cannot initialize external console.</message>
<message>Request event</message>
<message>System Error. Code: 5.</message>
<message>Access is denied</message>
</failure>

Can you let me know how to resolve this error?

I'm attaching a full debug log that I've created. I want to add that debug log and normal log location is the same.

Best Regards,
Lukas
log-6392510.zip (2.25 KB) [Download]

Description: (none)

Advertisements
Lukas FIlim

Guest


Hi ,

I'm also getting second error : Cannot initialize external console.

I know I have write permissions in web application and in c:\windows\temp\ however I'm missing something here.

Best Regards,
Lukas
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26299
Location: Prague, Czechia
Can you describe the environment that you are using WinSCP .NET assembly in?
Lukas Filim

Guest


martin wrote:
Can you describe the environment that you are using WinSCP .NET assembly in?


I'm running Win SCP o Windows Server 2008 R2 which is one of 2 web servers which are managed by Load Balancer.
What else would you liek to know?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26299
Location: Prague, Czechia
So do you run WinSCP from your website code? Is it IIS/ASP?
Lukas Filim

Guest


martin wrote:
So do you run WinSCP from your website code? Is it IIS/ASP?


Yes I'm running WinSCp from website code that runs on IIS7 with .Net 4.0
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26299
Location: Prague, Czechia
You might need to set the Session.ExecutableProcessUserName and Session.ExecutableProcessPassword (available in WinSCP 5.8.x RC only).

See
https://winscp.net/tracker/show_bug.cgi?id=1334
https://winscp.net/eng/docs/message_cannot_initialize_external_console
Lukas Filim

Guest


Hi Martin,

I've used both fields : Session.ExecutableProcessUserName and Session.ExecutableProcessPassword
I've set them to use admin user on the server and error 'Cannot initialize external console.Request event.System Error. Code: 5.Access is denied.' is gone however I'm getting another error : System.ComponentModel.Win32Exception (0x80004005): Access is denied at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)

I found on web that this can be caused by incorrect login details or super user. I can use normal version of WinSCP not thru .Net component on the same server and connect. How can I resolve this error??

Best Regards,
Lukas
fundoo

Guest


Even after setting Session.ExecutableProcessUserName and Session.ExecutableProcessPassword it is not working.
But error message changed from 'Cannot initialize external console.Request event.System Error. Code: 5.Access is denied.' to 'Access is denied.'
Can someone help me.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26299
Location: Prague, Czechia
In general, WinSCP .NET assembly is not the right tool to be used for web development:
https://winscp.net/eng/docs/library#purpose
swatikhangar
[View user's profile]

Joined: 2017-04-05
Posts: 1
Dear Team,

I am using WinSCP 5.9.0.0 version for file transfer from Server to Local machine .
When I run it through code its running, but when hosted in IIS 7.5 its not working.
Application is a web page in C# .net 4.0.

I am getting
"Cannot initialize external console. Request event System Error. Code: 5. Access is denied" error .
Session not open and getting SessionRemoteException type exception
code used

SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Sftp,
HostName = strHostName,
UserName = strUserName,
Password = strPassword,
PortNumber = Convert.ToInt16(strPortNumber),
GiveUpSecurityAndAcceptAnySshHostKey = true

};

using (Session session = new Session())
{

session.Open(sessionOptions);

SynchronizationResult synchronizationResult;
synchronizationResult =
session.SynchronizeDirectories(
SynchronizationMode.Local, strDownloadFilePath + remotepathdate + "\\", remotePath, false);

synchronizationResult.Check();

}


//strDownloadFilePath : local path where file to be download

Please revert.

Thank you.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26299
Location: Prague, Czechia
swatikhangar wrote:
Dear Team,

I am using WinSCP 5.9.0.0 version for file transfer from Server to Local machine .
When I run it through code its running, but when hosted in IIS 7.5 its not working.
Application is a web page in C# .net 4.0.

I am getting
"Cannot initialize external console. Request event System Error. Code: 5. Access is denied" error .
Session not open and getting SessionRemoteException type exception

Did you read my posts above?
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