WinSCP process terminated with exit code -1073741515 (C0000135)

Advertisement

abraham.dominic
Joined:
Posts:
4
Location:
India

WinSCP process terminated with exit code -1073741515 (C0000135)

While a session is opened and trying to upload or download a file from SFTP, it does not work. Instead, an error message pops up saying:
System.Exception: Unable to connect FTP location , WinSCP.SessionLocalException: WinSCP process terminated with exit code -1073741515 (C0000135). There was no output. Response log file C:\Windows\Temp\wscp660C.001DC84D.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) at
The .NET component is hosted on mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019 containers and recently migrated to .NET 5 and is running on mcr.microsoft.com/dotnet/aspnet:5.0. the containers are hosted on AWS EKS windows nodes. the application is working locally when debugged using Visual Studio.

Since it is an access denied issue, I ran container under USER ContainerAdministrator and also tried to provided explicit access using corresponding folders using icacls from docker file; still issue persist. pls note that component it self has access to write to temp folder but WinSCP.exe.
RUN c:\windows\system32\icacls "c:\app" /grant "everyone":(OI)(CI)F
RUN c:\windows\system32\icacls "c:\windows\temp" /grant "everyone":(OI)(CI)F
RUN c:\windows\system32\icacls "c:\app\jobapi\temp" /grant "everyone":(OI)(CI)F
RUN c:\windows\system32\icacls "c:\app\jobapi\WinSCP.exe" /grant "everyone":(OI)(CI)F
Using WinSCP 5.19.2 NuGet package. Application is developed on .NET 5.

Has any one encountered such an issue? kindly support.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: WinSCP process terminated with exit code -1073741515 (C0000135)

Why do you think it's an "access denied" issue? The C0000135 seems to mean "Unable to locate component".

Reply with quote

abraham.dominic
Joined:
Posts:
4
Location:
India

Re: WinSCP process terminated with exit code -1073741515 (C0000135)

It is throwing the error
Exception occurred while downloading file from sftp server dev.sftp.xyz.com/sftp-bucket-dev/ - EDI_Deals ErrorMessage: Unable to connect FTP location , WinSCP.SessionLocalException: WinSCP process terminated with exit code -1073741515 (C0000135). There was no output. Response log file c:\app\jobapi\logs\ was not created. This could indicate lack of write permissions to the log folder or problems starting WinSCP itself.
when checked all components are included in the package built and deployed. is there any way to understand which component is missing?

Reply with quote

martin
Site Admin
martin avatar

Re: WinSCP process terminated with exit code -1073741515 (C0000135)

Please give us instructions for reproducing the problem. How exactly did you deploy your project and WinSCP to that system?

Reply with quote

abraham.dominic
Joined:
Posts:
4
Location:
India

Re: WinSCP process terminated with exit code -1073741515 (C0000135)

Created .NET 5 project. Referenced WinSCP NuGet package and upload a file to SFTP location. Application is deployed to Docker Desktop and to Windows container. Docker Desktop is running under WSL2 mode. Attached here with the docker and WinSCP xml log file for your reference.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: WinSCP process terminated with exit code -1073741515 (C0000135)

When I build your Dockerfile, I get "Linux 5.10.16.3-microsoft-standard-WSL2" system. Not a Windows system.

Reply with quote

abraham.dominic
Joined:
Posts:
4
Location:
India

Re: WinSCP process terminated with exit code -1073741515 (C0000135)

you might need to change the docker desktop setting to switch to Windows containers and build it.
  • MicrosoftTeams-image.png (12.08 KB, Private file)

Reply with quote

martin
Site Admin
martin avatar

Re: WinSCP process terminated with exit code -1073741515 (C0000135)

Sorry, it took me while to test this. After switching to Windows containers, everything works. I do not get the error your are describing. I've used very basic WinSCP .NET code, like the one here:
https://winscp.net/eng/docs/library#csharp
I did not need to set any permissions or anything else.

Reply with quote

niltonwjr
Joined:
Posts:
3
Location:
Brazil

Martin, could you share a example of this project running .NET Core + WinSCP NuGet on Windows container with this simple code?

I'm having the same issue reported by @abraham when I try run a Windows container using Docker Desktop. If you need a example I can post a GitHub repo to reproduce the error. I tried using .NET Core 3.1, 5.0 and 6.0 and in all of those I get the same error.

Description: EXCEPTION.

WINSCP.png

Reply with quote

Advertisement

martin
Site Admin
martin avatar

@niltonwjr: I do not think there's any code to show. I've actually posted a link to a code I've used in my previous post. But again, the code is hardly relevant. The error is unrelated to the code. It's rather about the environment. Can you post complete sample project including your Docker container setup?

Reply with quote

martin
Site Admin
martin avatar

Thanks. Though, can you guide me further? I've very little experience with Docker. How do I run your project? What command do I use? Or should I be able to use it from Visual Studio?

Reply with quote

niltonwjr
Joined:
Posts:
3
Location:
Brazil

Martin, I'm using Visual Studio to run and debug the app, the LaunchSettings has a profile to run it using Docker, just select it and run in a container.

As @abraham.dominic mentioned, your Docker Desktop need to be set to run Windows containers.
ps: If your Docker Desktop is configured to run Linux containers it will ask to you if you want to change to Windows container when your start the app.

Reply with quote

Advertisement

mfuscolin
Guest

WinSCP process terminated with exit code -1073741515 (C0000135) ECS Farget Windows Container

I have the same problem in windows container ECS Fargate. I using .NET Core 3.1.

aws.png

Reply with quote

ryanhenderson
Joined:
Posts:
1
Location:
Houston, Texas, USA

SOLVED - Re: WinSCP process terminated with exit code -1073741515 (C0000135)

I'm not OP, but we were running into this same issue and found a fix that works for us.

The issue appears to be that WinSCP does not work on the Nano Server images. You must use Windows Server Core.
https://hub.docker.com/r/microsoft/dotnet-aspnet

Does Not Work: mcr.microsoft.com/dotnet/aspnet:7.0
Does Work: mcr.microsoft.com/dotnet/aspnet:7.0-windowsservercore-ltsc2019

Reply with quote

Advertisement

You can post new topics in this forum