Topic "SessionRemoteException: Cannot initialize external console"

Author Message
diegopolanco
[View user's profile]

Joined: 2015-03-11
Posts: 1
Location: COLOMBIA
Hi. I have a problem when i use WinSCP .NET Assembly and i try to connect to SFTP Server, the error is WINSCP.SessionRemoteException: Cannot initialize external console . I attach DebugLog.log. Thanks for your help.
DebugLogServer.log (17.13 KB) Private file

Description: Debuglog.log file

Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
Thanks for your report.
I have sent you an email with a debug version of WinSCP to address you have used to register on this forum.
_________________
Martin Prikryl
jono06
[View user's profile]

Joined: 2015-04-16
Posts: 1
Hi, I am currently having the same problem. I receive a "Cannot initialize external console." error when attempting to use the automation library through an IIS asp.net web site.
WinSCP.Debug.log (11.82 KB) Private file

Description: (none)

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
Thanks for your report.
I have sent you an email with a development version of WinSCP to address you have used to register on this forum.
ssch
[View user's profile]

Joined: 2015-04-21
Posts: 4
hello prikryl Can you please also send me the email with the same fix info. I am expeerienceing the same issue. And i have posted a blog. too.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
It's most likely the same problem as here:
https://winscp.net/forum/viewtopic.php?t=14308
For while I never found a solution unfortunately.
See also http://stackoverflow.com/questions/26019150/openevent-openfilemapping-fails-with-error-access-denied

In general WinSCP works in IIS environment, just not in some setups.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
This issue has been added to the tracker:
https://winscp.net/tracker/show_bug.cgi?id=1317
xdu17
[View user's profile]

Joined: 2015-05-21
Posts: 2
Location: LR
Hi,

I've got the same problem with IIS .NET, but only in an impersonate user environment (works fine without impersonation). BTW, DebugLogPath file with the "Cannot initialize external console" is generated only if the XmlLogPath is set.

Without XmlLogPath :

[2015-05-21 15:12:06.319Z] [0007] E:\ECMHomedir\bin\WinSCP.exe - exists [True]
[2015-05-21 15:12:06.319Z] [0007] Exception: WinSCP.SessionLocalException: WinSCP process terminated with exit code 0 and output "", without responding (response log file C:\Windows\TEMP\wscp11D4.0324493A.tmp was not created). This could indicate lack of write permissions to the log folder or problems starting WinSCP itself.
[2015-05-21 15:12:06.319Z] [0007] Exception: WinSCP.SessionLocalException: WinSCP process terminated with exit code 0 and output "", without responding (response log file C:\Windows\TEMP\wscp11D4.0324493A.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)
[2015-05-21 15:12:06.335Z] [0007] Session.Cleanup entering
[2015-05-21 15:12:06.335Z] [0007] Terminating process

With XmlLogPath :

[2015-05-21 15:13:34.134Z] [000a] ExeSessionProcess.InitializeChild entering
[2015-05-21 15:13:34.134Z] [000a] Starting "E:\ECMHomedir\bin\WinSCP.exe" /xmllog="E:\ECMHomedir\App_Data\Log\WinSCPXMLLog.log" /xmlgroups /nointeractiveinput /dotnet=571 /ini=nul /log="E:\ECMHomedir\App_Data\Log\WinSCPLog.log" /console /consoleinstance=_4564_63130991_611
[2015-05-21 15:13:34.134Z] [000a] Started process 1088
...
[2015-05-21 15:13:34.353Z] [000a] Log contents:
<?xml version="1.0" encoding="UTF-8"?>
<session xmlns="https://winscp.net/schema/session/1.0" name="nosession" start="2015-05-21T13:13:34.274Z">
<failure>
<message>Cannot initialize external console.</message>
</failure>
</session>
...
[2015-05-21 15:13:34.353Z] [000a] Read node 8: Text Cannot initialize external console.
[2015-05-21 15:13:34.353Z] [000a] Log contents has not changed
[2015-05-21 15:13:34.353Z] [000a] SessionLogReader.Read leaving
[2015-05-21 15:13:34.353Z] [000a] SessionLogReader.Read entering
[2015-05-21 15:13:34.353Z] [000a] Read node 9: EndElement message
[2015-05-21 15:13:34.353Z] [000a] Log contents has not changed
[2015-05-21 15:13:34.353Z] [000a] SessionLogReader.Read leaving
[2015-05-21 15:13:34.353Z] [000a] SessionLogReader.Read entering
[2015-05-21 15:13:34.353Z] [000a] Read node 10: Whitespace

[2015-05-21 15:13:34.353Z] [000a] Log contents has not changed
[2015-05-21 15:13:34.368Z] [000a] SessionLogReader.Read leaving
[2015-05-21 15:13:34.368Z] [000a] SessionLogReader.Read entering
[2015-05-21 15:13:34.368Z] [000a] Read node 11: EndElement failure
[2015-05-21 15:13:34.368Z] [000a] Log contents has not changed
[2015-05-21 15:13:34.368Z] [000a] SessionLogReader.Read leaving
[2015-05-21 15:13:34.368Z] [000a] Exception: WinSCP.SessionRemoteException: Cannot initialize external console.
[2015-05-21 15:13:34.368Z] [000c] Process 1088 exited with exit code 0
[2015-05-21 15:13:34.368Z] [000c] Exited
[2015-05-21 15:13:34.368Z] [000c] ExeSessionProcess.ProcessEvents leaving
[2015-05-21 15:13:34.368Z] [000a] ElementLogReader.Dispose entering
[2015-05-21 15:13:34.368Z] [000a] ElementLogReader.ReadToEnd entering
[2015-05-21 15:13:34.368Z] [000a] ElementLogReader.ReadToEnd leaving
[2015-05-21 15:13:34.368Z] [000a] ElementLogReader.Dispose leaving
[2015-05-21 15:13:34.368Z] [000a] Failed: [WinSCP.SessionRemoteException: Cannot initialize external console.]
[2015-05-21 15:13:34.368Z] [000a] SessionLogReader.Read leaving
[2015-05-21 15:13:34.368Z] [000a] Exception: WinSCP.SessionRemoteException: Cannot initialize external console.
at WinSCP.SessionLogReader.Read(LogReadFlags flags)
at WinSCP.ElementLogReader.Read(LogReadFlags flags)
at WinSCP.SessionElementLogReader.Read(LogReadFlags flags)
at WinSCP.CustomLogReader.TryWaitForNonEmptyElement(String localName, LogReadFlags flags)
at WinSCP.CustomLogReader.WaitForNonEmptyElement(String localName, LogReadFlags flags)
at WinSCP.CustomLogReader.WaitForGroupAndCreateLogReader()
at WinSCP.Session.Open(SessionOptions sessionOptions)
[2015-05-21 15:13:34.368Z] [000a] Session.Cleanup entering
[2015-05-21 15:13:34.368Z] [000a] Terminating process
[2015-05-21 15:13:34.368Z] [000a] Command: [exit]

Hope this help !
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
Thanks for the details.
Can you guide me how to setup the "impersonated user environment"?
xdu17
[View user's profile]

Joined: 2015-05-21
Posts: 2
Location: LR
Hello prikryl,

In IIS, you can configure web.config file with option :
<identity impersonate="true" />

In this case, the user that runs .NET application is not the service account user used by IIS application pool, but another user, often the user identified by website. I know that this "impersonation" is not exactly what Windows does with the "runas" command. For example, user environment is not loaded...

MSDN says that about impersonation : https://msdn.microsoft.com/en-us/library/xh507fc5.aspx
and for ACL on impersonate .NET programs : https://msdn.microsoft.com/en-us/library/kwzs111e.aspx

Thank you for your help
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
Thanks. I'll try to set this up.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
I was able to reproduce the problem.
I will try to fix it.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
This issue has been added to the tracker:
https://winscp.net/tracker/show_bug.cgi?id=1334
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