dotnet / core

.NET news, announcements, release notes, and more!
https://dot.net
MIT License
20.97k stars 4.91k forks source link

watch : Exited with error code 139 watch : Waiting for a file to change before restarting dotnet... #7112

Open Kwofie-mex opened 2 years ago

Kwofie-mex commented 2 years ago

Problem encountered on https://dotnet.microsoft.com/en-us/learn/aspnet/blazor-tutorial/run Operating System: linux

Provide details about the problem you're experiencing. Include your operating system version, exact error message, code sample, and anything else that is relevant.

mairaw commented 2 years ago

@danroth27 can you assist with this?

danroth27 commented 2 years ago

Hmm...not sure. @pranavkm ?

pranavkm commented 2 years ago

139 usually means access violation. Is this error consistent? Do you get this running other dotnet commands?

rosgori commented 2 years ago

Yes! This is a little bit worrying. This happens when I want to run a small project in .NET 6 or .NET 5. This message is:

watch : Started

watch : Exited with error code 139
watch : Waiting for a file to change before restarting dotnet...

And that appears when I use the command dotnet watch run or dotnet run. Also when I try to run from the folder bin/Debug/My-project, another message appears: Violación de segmento ('core' generado), which translates to English (if I am not mistaken) as Core Dump (Segmentation fault). I don't know why this happens and I cannot use .NET in my machine.

Some info:

rosgori commented 2 years ago

Same problem with dotnet version 6.0.102.

danroth27 commented 2 years ago

Is it possible you're building from/to a protected directory?

rosgori commented 2 years ago

The solution is weird, I don't know why. I have installed dotnet through snap and it was working fine, no problem there. Suddenly on February when I tried to run some projects, it didn't work, it showed watch : Exited with error code 139. I tried two possible solutions: the first one, I downloaded the binaries from here and I used the executable (for the versions 5 and 6). Same error. The second solution was to install from apt (I am using Ubuntu) using this guide. It worked!. Again, I don't know why, but I can run any project using dotnet run or dotnet watch run. Although this does not answer the question: why did that kind of error show up?

mot256 commented 2 years ago

We were debugging an issue where our .NET containers (linux) sometimes exit with 139 errors and I later found that if the .NET app (which runs as the entrypoint to the container) throws an unhandled exception (same as in @rosgori's comment), then the container consistently has an exit code of 139. What is even more confusing is that if you shell into the same container and run the "dotnet my-app.dll" manually you get an exit code of 134 (Abort) when an unhandled exception is thrown. You can simulate this with any .NET app (from 3.1 to 6.0) where you simply throw an exception in the Main method.

bijeaylimbu commented 2 years ago

https://github.com/dotnet/core/issues/7112#issuecomment-1033292899 thanks your solutions works

omajid commented 2 years ago

We are trying to fix our docs to warn people about snap being mostly broken for dotnet tools: https://github.com/dotnet/docs/pull/31045

Sidjay00 commented 1 year ago

The solution is weird, I don't know why. I have installed dotnet through snap and it was working fine, no problem there. Suddenly on February when I tried to run some projects, it didn't work, it showed watch : Exited with error code 139. I tried two possible solutions: the first one, I downloaded the binaries from here and I used the executable (for the versions 5 and 6). Same error. The second solution was to install from apt (I am using Ubuntu) using this guide. It worked!. Again, I don't know why, but I can run any project using dotnet run or dotnet watch run. Although this does not answer the question: why did that kind of error show up?

Thank you so much! The 2nd solution did helped me.

nandafirmans commented 11 months ago

I'm getting the same issue on archlinux, I'm using dotnet 6.0 I had no clue why this happen, I already try install manually, by script dotnet-install.sh and also from aur package dotnet-sdk-6.0


dotnet watch ❌ Exited with error code 139
dotnet watch ⏳ Waiting for a file to change before restarting dotnet...```
danroth27 commented 11 months ago

@nandafirmans I don't do much on Linux, but it doesn't look like archlinux is currently on the supported distro list for .NET 8: https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md.

@richlander Do you know if there are known issues running .NET on archlinux?

diegodfsd commented 11 months ago

Does anyone have updates regarding this issue? We are currently using .NET Core SDK 7 (mcr.microsoft.com/dotnet/sdk:7.0) on Amazon Elastic Container Service (ECS). For several weeks now, we have been encountering these errors where the container is abruptly terminated with exit code 139. Unfortunately, there is no additional information provided to help us comprehend the root cause of the error.

arhue commented 10 months ago

Facing the same issue as @diegodfsd above. Tried Ubuntu amd64 and Alpine amd64 docker image. Same issue. Host OS is Ubuntu. Nothing in logs. Seems more easily triggered on Ubuntu vs Alpine, which takes longer. Tried debugging it for weeks now.

huzaynbolt commented 3 months ago

@arhue / @diegodfsd Do you have fix to this issue yet? It's being a bottle neck for one of my service with similar setup on ECS

diegodfsd commented 3 months ago

Hi @huzaynbolt we solved our problem. In our case, the cause behind the abruptly terminated ECS Tasks was the usage of the IronPdf library that uses chromium, but after we made the library upgrade the issue was fixed.

huzaynbolt commented 3 months ago

How do your debug on ECS then? That's my struggle at the moment. Since ECS terminated the task upon the error and I can't retrieve the logs after it stopped

arhue commented 2 months ago

@huzaynbolt Sorry about the delay, missed the notification. Yes, for us it was because application was running out of memory