WinSCP 5.8.2 automation error

Advertisement

Lukas Filim
Guest

WinSCP 5.8.2 automation error

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

Reply with quote

Advertisement

Lukas FIlim
Guest

Second Error

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

Reply with quote

Lukas Filim
Guest

Re: WinSCP 5.8.2 automation error

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?

Reply with quote

Advertisement

Lukas Filim
Guest

Re: WinSCP 5.8.2 automation error

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

Reply with quote

Lukas Filim
Guest

Re: WinSCP 5.8.2 automation error

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

Reply with quote

fundoo
Guest

I am also getting exaction same error

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.

Reply with quote

Advertisement

swatikhangar
Joined:
Posts:
1

Cannot initialize external console. Request event System Error. Code: 5. Access is denied

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.

Reply with quote

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

Re: Cannot initialize external console. Request event System Error. Code: 5. Access is denied

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?

Reply with quote

Vishaish Pandita
Guest

Solution to this problem.

Hi there,
After a lot of R&D, I found out that I was using <impersonate> in my web configuration file and that was expecting a same user on ftp server also, which was not the case and that's why I was getting the same error. Just removed that line from configuration file and it worked like charm.
Not as big issue as I thought.
Hope it helps someone.
Happy coding.
Tadaaaa.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum