Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Vishaish Pandita

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.
martin

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?
swatikhangar

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.
fundoo

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.
Lukas Filim

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
Lukas Filim

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
martin

Re: WinSCP 5.8.2 automation error

So do you run WinSCP from your website code? Is it IIS/ASP?
Lukas Filim

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?
martin

Re: WinSCP 5.8.2 automation error

Can you describe the environment that you are using WinSCP .NET assembly in?
Lukas FIlim

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
Lukas Filim

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