dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.48k stars 10.04k forks source link

`PollingFileWatcher` Issue while running `dotnet watch run` with wsl volume mounts #26492

Open pawan-regoti opened 4 years ago

pawan-regoti commented 4 years ago

Describe the bug

A clear and concise description of what the bug is.

I have a dotnet core project which is stored in c drive of my windows system. I have wsl2 integration with my docker desktop.

I am trying to run my application in docker using dotnet watch run and wanted to reflect the changes I do in MySampleService in docker build.

When I do docker-compose up

I am getting following error in docker logs:

FilePollingIssue

Expected behavior

dotnet watch run executes without any issues and track the file changes done in MySampleService folder

Actual behavior

PollingFileWatcher issue is occurring sometimes

To Reproduce

I have following folder structure:

Following is my docker-compose.yml

version: "2.1"
services:
  my-sample-service:
    image: mcr.microsoft.com/dotnet/core/sdk:3.1-alpine
    working_dir: /usr/src/app/MySampleService
    volumes:
      - ./MySampleService:/usr/src/app/MySampleService
    environment:
      "DOTNET_USE_POLLING_FILE_WATCHER": 1
    entrypoint: "dotnet watch run --urls=http://0.0.0.0:5010"
    ports:
      - 5010:5010
    healthcheck:
      test: wget --quiet --spider http://localhost:5010/api/ping || exit 1
      interval: 60s
      timeout: 5s
      retries: 20

Exceptions (if any)

Further technical details

Runtime Environment: OS Name: Windows OS Version: 10.0.19041 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.1.302\

Host (useful for support): Version: 3.1.6 Commit: 3acd9b0cd1

.NET Core SDKs installed: 2.1.201 [C:\Program Files\dotnet\sdk] 2.1.202 [C:\Program Files\dotnet\sdk] 2.1.500 [C:\Program Files\dotnet\sdk] 2.1.505 [C:\Program Files\dotnet\sdk] 2.1.507 [C:\Program Files\dotnet\sdk] 2.1.516 [C:\Program Files\dotnet\sdk] 2.2.101 [C:\Program Files\dotnet\sdk] 3.1.101 [C:\Program Files\dotnet\sdk] 3.1.302 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download



- The IDE (VS / VS Code/ VS4Mac) you're running on, and it's version: using command prompt to build and run

Can somebody help me in fixing this issue? 🙂
ghost commented 4 years ago

Thanks for contacting us. We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

prooli22 commented 4 years ago

I'm experiencing the same behavior, the thing I've been able to find is that it's not always the same Services/Modules that triggers the error. Any news on this ?

pawan-regoti commented 4 years ago

@prooli22 I moved my projects into WSL (~/src/project) and run docker from there, it gives a good performance boost and you can use VS 2019 to edit and build, if you assigned WSL as a network drive.

Maybe, this can help https://medium.com/@regotipawan/make-the-most-of-wsl-c30abcf80541

mattjbrent commented 3 years ago

Im having an issue with getting dotnet watch run to work inside docker, mapped to a volume mount on OSX also. ENV DOTNET_USE_POLLING_FILE_WATCHER 1 is used. Not sure if this is the same issue or not. I can provide more info if req. or create a new issue.

ghost commented 3 years ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

pawan-regoti commented 1 year ago

Hi @jkotalik / @mkArtakMSFT , what is the status of the issue, is it fixed already, or is it still in backlog?