dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.72k stars 430 forks source link

Hosting failed to start #4750

Closed kinfey closed 2 months ago

kinfey commented 3 months ago

I use .NET Aspire , macOS is okay ,but when I move to Windows 11 using Powershell and WSL , it always show me Hosting failed to start C:\Program Files\dotnet\packs\Aspire.Hosting.Orchestration.win-x64\8.0.2\tools\dcp.exe info returned non-zero exit code -1

I need to restart my win11 and run again


info: Aspire.Hosting.DistributedApplication[0]
      Aspire version: 8.0.2+3d0cf817f24298ba37bca94f15bd2f7061856e77
info: Aspire.Hosting.DistributedApplication[0]
      Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
      Application host directory is: C:\Users\kinfeylo\Desktop\AOAI\SLM\phi3\dotNET\Phi3DotNETAspire\Phi3.Aspire.AppHost
fail: Microsoft.Extensions.Hosting.Internal.Host[11]
      Hosting failed to start
      System.InvalidOperationException: Command C:\Program Files\dotnet\packs\Aspire.Hosting.Orchestration.win-x64\8.0.2\tools\dcp.exe info returned non-zero exit code -1
         at Aspire.Hosting.Dcp.Process.ProcessUtil.ProcessDisposable.DisposeAsync() in /_/src/Aspire.Hosting/Dcp/Process/ProcessUtil.cs:line 155
         at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 115
         at Aspire.Hosting.Dcp.DcpHostService.StartAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpHostService.cs:line 67
         at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__15_1(IHostedService service, CancellationToken token)
         at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
Unhandled exception. System.AggregateException: One or more errors occurred. (Command C:\Program Files\dotnet\packs\Aspire.Hosting.Orchestration.win-x64\8.0.2\tools\dcp.exe info returned non-zero exit code -1)
---> System.InvalidOperationException: Command C:\Program Files\dotnet\packs\Aspire.Hosting.Orchestration.win-x64\8.0.2\tools\dcp.exe info returned non-zero exit code -1
   at Aspire.Hosting.Dcp.Process.ProcessUtil.ProcessDisposable.DisposeAsync() in /_/src/Aspire.Hosting/Dcp/Process/ProcessUtil.cs:line 155    
   at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 115
   at Aspire.Hosting.Dcp.DcpHostService.StartAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpHostService.cs:line 67
   at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__15_1(IHostedService service, CancellationToken token)
   at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Aspire.Hosting.DistributedApplication.RunAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/DistributedApplication.cs:line 310
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Aspire.Hosting.DistributedApplication.Run() in /_/src/Aspire.Hosting/DistributedApplication.cs:line 338
   at Program.<Main>$(String[] args) in C:\Users\kinfeylo\Desktop\AOAI\SLM\phi3\dotNET\Phi3DotNETAspire\Phi3.Aspire.AppHost\Program.cs:line 33

My .NET version 8.0.302

.NET Aspire - 8.0.2

kinfey commented 3 months ago

In WSL , we have same error , you need to restart your labtop


fail: Microsoft.Extensions.Hosting.Internal.Host[11]
      Hosting failed to start
      Aspire.Hosting.DistributedApplicationException: Application orchestrator dependency check had an unexpected error System.TimeoutException: The operation has timed out.
         at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 78.
         at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 105
         at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 115
         at Aspire.Hosting.Dcp.DcpHostService.StartAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpHostService.cs:line 67
         at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__15_1(IHostedService service, CancellationToken token)
         at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
Unhandled exception. System.AggregateException: One or more errors occurred. (Application orchestrator dependency check had an unexpected error System.TimeoutException: The operation has timed out.
   at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 78.)
 ---> Aspire.Hosting.DistributedApplicationException: Application orchestrator dependency check had an unexpected error System.TimeoutException: The operation has timed out.
   at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 78.
   at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 105
   at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 115
   at Aspire.Hosting.Dcp.DcpHostService.StartAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpHostService.cs:line 67
   at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__15_1(IHostedService service, CancellationToken token)
   at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Aspire.Hosting.DistributedApplication.RunAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/DistributedApplication.cs:line 310
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Aspire.Hosting.DistributedApplication.Run() in /_/src/Aspire.Hosting/DistributedApplication.cs:line 338
   at Program.<Main>$(String[] args) in /mnt/c/Users/kinfeylo/Desktop/AOAI/SLM/phi3/dotNET/Phi3DotNETAspire/Phi3.Aspire.AppHost/Program.cs:line 33
luisquintanilla commented 2 months ago

After spending some time with @kinfey, the OnnxRuntime GenAI scenario in Aspire Kinfey is building worked on my machine.

image

Some details:

Aspire Version

aspire 8.0.1/8.0.100

Model

Phi-3-mini-4k-instruct-onnx (cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4)

Hardware

CPU

image

Memory

64GB

Next steps

Since Kinfey's PC is a newer AI PC, we'd want to investigate / validate what the potential issues are that prevent the sample from working on his PC:

cc: @natke @Vivihung

karolz-ms commented 2 months ago

@kinfey @luisquintanilla so are you good/unblocked for now?

We made some fixes that will ship in the next Aspire release. These fixes should give you a better, more informative error message than just dcp info exited with code -1.

luisquintanilla commented 2 months ago

@karolz-ms I'm okay with closing. If further investigations reveal the issues are with Aspire, we can open a new issue.

@kinfey are you okay with that?

karolz-ms commented 2 months ago

Closing for now--we should be good in 8.1. Re-open or open a new issue please if problems persist in 8.1 release.