microsoft / DockerTools

Tools For Docker, including Visual Studio Provisioning and Publishing
Other
175 stars 26 forks source link

VS hangs when docker compose fails to create service #309

Closed DatKyle closed 3 years ago

DatKyle commented 3 years ago

Hi,

My docker project consists of the following services:

  1. Web (C# .NET5)
  2. Web.Angular (12 with ng-zorro)
  3. Web.Backoffice (C# .NET5)
  4. AzureFunction (C# .NET5 isolated)
  5. Azurite (3.14.2)

When I try and run the docker-compose project from a fresh repo, VS runs npm install. however, when it has finished installing the packages and tries to start the container, it throws the below error and then VS gets stuck in Not Responding. Cannot create container for services web: Post "http://ipc/filesharing/share": context deadline exceeded (Client.Timeout exceeded while awaintg headers).

I'm not too bothered by the error, when we restart VS and run the compose project again it works fine, just when you do the initial npm install that it throws an error. The major issue is that VS is stuck in a not responding state and it doesn't seem to ever recover.

DatKyle commented 3 years ago

Incase any setup information is needed

Versions

Node

Node: 16.9.0 npm: 7.21.1

Docker:

Client: Cloud integration: 1.0.17 Version: 20.10.8 API version: 1.41 Go version: go1.16.6 Git commit: 3967b7d Built: Fri Jul 30 19:58:50 2021 OS/Arch: windows/amd64 Context: default Experimental: true

Server: Docker Engine - Community Engine: Version: 20.10.8 API version: 1.41 (minimum version 1.12) Go version: go1.16.6 Git commit: 75249d8 Built: Fri Jul 30 19:52:10 2021 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.4.9 GitCommit: e25210fe30a0a703442421b0f60afac609f950a3 runc: Version: 1.0.1 GitCommit: v1.0.1-0-g4144b63 docker-init: Version: 0.19.0 GitCommit: de40ad0

Visual Stuido

Microsoft Visual Studio Enterprise 2019 Version 16.11.2 VisualStudio.16.Release/16.11.2+31624.102 Microsoft .NET Framework Version 4.8.04084

Installed Version: Enterprise

ADL Tools Service Provider 1.0 This package contains services used by Data Lake tools

ASA Service Provider 1.0

ASP.NET and Web Tools 2019 16.11.75.64347 ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2012 16.11.75.64347 For additional information, visit https://www.asp.net/

ASP.NET Web Frameworks and Tools 2019 16.11.75.64347 For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.11.75.64347 Azure App Service Tools v3.0.0

Azure Data Lake Node 1.0 This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio 2.6.1000.0 Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools 16.11.75.64347 Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio 2.6.1000.0 Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools 3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Fabric.DiagnosticEvents 1.0 Fabric Diagnostic Events

IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure HDInsight Azure Node 2.6.1000.0 HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service 2.6.1000.0 Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio 16.10 Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service 2.6.1000.0 Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node 1.0 Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools for Visual Studio 2.9 Support for Azure Cloud Services projects

Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 2.1.113+g422d40002e.RR Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio Tools for Containers 1.2 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Node.js Tools 1.5.30526.3 Commit Hash:c09c81113bcbc86d57943fcdd67e82434263d61d Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager 5.11.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info

Razor (ASP.NET Core) 16.1.0.2122504+13c05c96ea6bdbe550bd88b0bf6cdddf8cde1725 Provides languages services for ASP.NET Core Razor.

Snapshot Debugging Extension 1.0 Snapshot Debugging Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.62107.28140 Microsoft SQL Server Data Tools

ToolWindowHostedEditor 1.0 Hosting json editor into a tool window

TypeScript Tools 16.0.30526.2002 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10 Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 16.11.0-beta.21322.6+488cc578cafcd261d90d748d8aaa7b8b091232dc Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions 1.0 View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers

Visual Studio Tools for Kubernetes 1.0 Visual Studio Tools for Kubernetes

ucheNkadiCode commented 3 years ago

Hey @DatKyle, Is there any way you could provide an example of your sample solution so we could investigate this? Could you give us the minified repro steps?

DatKyle commented 3 years ago

I've made the below repo which has the same issue: .Net Angular demo with split contianers

When I run the compose project for the first time the project builds and then once complete it tries to start the Web and Angular containers. it says it has started both containers but the Web container doesn't appear to do anything and VS becomes unresponsive. If I restart VS and click run again the 2 containers are created again and run without issue.

dbreshears commented 3 years ago

Hi @DatKyle . Thanks for the quick repro project. Unfortunately I get a 404, can you look into?

DatKyle commented 3 years ago

Sorry, the repo was set to private; I've updated it to the public now :)

dbreshears commented 3 years ago

Thanks. that worked much better. I was able to reproduce the issue for the VS being unresponsive for a very long period of time but eventually it does launch the angular web site. A quick investigation it appeared to be related to directory watcher crawling folders under clientapp, specifically node modules where there is a ton of files, and that happening on the main thread which shouldn' t be.

I did try the repro project on our latest (unreleased) VS 2022 Preview and I wasn't able to reproduce either time I tried with a clean environment (no contianers/images and git clean'd). Curious if you have tried on the latest released VS 2022 Preview to see if you still reproduce.

DatKyle commented 3 years ago

Hi, sorry for the slow reply.

I've tried it on VS 2022, and it works as expected 🙂

Do you know if the change in VS 2022 will be applied to 2019 as well? Or is it just for 2022 onwards?

Thank you for the help and responses.

dbreshears commented 3 years ago

Hi @DatKyle, VS2022 has many performance related fixes including the transition to x64. It is not feasible to attempt to backport these to VS2019. Thank you for the feedback!