Azure DevSpaces Container cannot be reached

143 Views Asked by At

I am getting an exception while starting the debugger for Azure Dev Spaces when using a fresh gRPC project from the template. The sample project on the quickstart .Net Core page for Azure DevSpaces debugs properly while my sample project does not within the same cluster. The sample project seems to use .Net Core 2.2 while my project uses 3.0. The following steps reproduce the issue:

  1. Open Visual Studio 2019 (v16.2.3)
  2. Click Create a new project
  3. Search for gRPC
  4. Click ASP.NET Core Web Application
  5. Give the project any name
  6. On the next screen, click gRPC Service - A project template for creating a gRPC ASP.NET Core service.
  7. Create the project
  8. Using the debug options, choose Azure Dev Spaces and configure the project to use the already set up cluster
  9. Start the debugger using Azure Dev Spaces

Expected: Debugger remains attached after docker steps are complete.

Actual:

  • Docker steps complete and a message that says Waiting for container... appears in the output window.
  • After a short time, a message that says: Service [service name] port 80 (HTTP) is available via port forwarding at [port] appears in the output window.
  • After that, the debugger gets detached and the following exception appears in the output window accompanied by an error modal that says the Container cannot be reached:
An error occurred during warmup for project 'DebugSample':
System.InvalidOperationException: Container cannot be reached.
   at Microsoft.Azure.DevSpaces.Client.Connection.ContainerConnector.<EnsureDevHostAgentConnectionAsync>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.DevSpaces.Client.Connection.ContainerConnector.<ConnectAsync>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.DevSpaces.Client.ManagementClients.ServiceManagementClientImplementation.<EnsureContainerConnectors>d__102.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Azure.DevSpaces.Client.ManagementClients.ServiceManagementClientImplementation.<ExecuteNextIterationAsync>d__98.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Azure.DevSpaces.Tools.Common.Client.DevSpacesServiceClient.<>c__DisplayClass28_0.<<StartDebugAsync>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Azure.DevSpaces.Tools.Common.Logging.PerfLoggerExtensions.<ExecuteOperationAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Azure.DevSpaces.Tools.Common.Client.DevSpacesServiceClient.<>c__DisplayClass28_0.<<StartDebugAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Azure.DevSpaces.Tools.Common.Logging.PerfLoggerExtensions.<ExecuteOperationAsync>d__3`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Azure.DevSpaces.Tools.Common.Logging.PerfLoggerExtensions.<ExecuteOperationAsync>d__3`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Azure.DevSpaces.Tools.Package.Services.DebugService.<WarmupProjectAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Azure.DevSpaces.Tools.Package.Services.BackgroundWarmupService.<>c__DisplayClass12_0.<<ExecuteWarmupAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Azure.DevSpaces.Tools.Common.Logging.PerfLoggerExtensions.<ExecuteOperationAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Azure.DevSpaces.Tools.Common.Logging.PerfLoggerExtensions.<ExecuteOperationAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Azure.DevSpaces.Tools.Package.Services.BackgroundWarmupService.<ExecuteWarmupAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Azure.DevSpaces.Tools.Package.Services.BackgroundWarmupService.<>c__DisplayClass9_0.<<WarmupProject>b__5>d.MoveNext()
0

There are 0 best solutions below