- diegopolanco
- Joined:
- Posts:
- 1
- Location:
- COLOMBIA
SessionRemoteException: Cannot initialize external console
Advertisement
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.
Advertisement
-
martin◆
Site Admin - Joined:
- Posts:
- 41,441
- Location:
- Prague, Czechia
Re: SessionRemoteException: Cannot initialize external console
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.
I have sent you an email with a debug version of WinSCP to address you have used to register on this forum.
- jono06
- Joined:
- 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.
-
martin◆
Site Admin
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.
I have sent you an email with a development version of WinSCP to address you have used to register on this forum.
- ssch
- Joined:
- 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.
Advertisement
-
martin◆
Site Admin - Joined:
- Posts:
- 41,441
- Location:
- Prague, Czechia
Re: SessionRemoteException: Cannot initialize external console
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 https://stackoverflow.com/q/26019150/850848
In general WinSCP works in IIS environment, just not in some setups.
https://winscp.net/forum/viewtopic.php?t=14308
For while I never found a solution unfortunately.
See also https://stackoverflow.com/q/26019150/850848
In general WinSCP works in IIS environment, just not in some setups.
-
martin◆
Site Admin
Re: SessionRemoteException: Cannot initialize external console
This issue has been added to the tracker:
https://winscp.net/tracker/1317
https://winscp.net/tracker/1317
- xdu17
- Joined:
- Posts:
- 2
- Location:
- LR
Re: SessionRemoteException: Cannot initialize external console
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 !
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◆
Site Admin
Re: SessionRemoteException: Cannot initialize external console
Thanks for the details.
Can you guide me how to setup the "impersonated user environment"?
Can you guide me how to setup the "impersonated user environment"?
Advertisement
- xdu17
- Joined:
- 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://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-3.0/xh507fc5(v=vs.85)
and for ACL on impersonate .NET programs :
https://learn.microsoft.com/en-us/previous-versions/kwzs111e(v=vs.140)
Thank you for your help
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://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-3.0/xh507fc5(v=vs.85)
and for ACL on impersonate .NET programs :
https://learn.microsoft.com/en-us/previous-versions/kwzs111e(v=vs.140)
Thank you for your help
-
martin◆
Site Admin
Thanks. I'll try to set this up.
-
martin◆
Site Admin
I was able to reproduce the problem.
I will try to fix it.
I will try to fix it.
-
martin◆
Site Admin
Re: SessionRemoteException: Cannot initialize external console
This issue has been added to the tracker:
https://winscp.net/tracker/1334
https://winscp.net/tracker/1334
Advertisement
You can post new topics in this forum