Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podman from WSL not found #1651

Open
1 task done
carlcamilleri opened this issue Sep 9, 2024 · 5 comments
Open
1 task done

Podman from WSL not found #1651

carlcamilleri opened this issue Sep 9, 2024 · 5 comments
Labels
⌚ Not Triaged Not triaged

Comments

@carlcamilleri
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Environment setup:

  • .NET Aspire app code checked out in the default WSL distribution
  • Podman installed as a separate WSL distribution
  • ~/.bash_aliases contains alias podman='podman-remote-static-linux_amd64'
  • In the WSL terminal, running podman images runs successfully

Error encountered: : Container runtime 'podman' could not be found. The error from the container runtime check was: exec: "podman": executable file not found in $PATH

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version info

No response

Anything else?

No response

@davidfowl
Copy link
Member

Looks similar to dotnet/aspire#5571. Unable to find an executable on the path. I wonder if this is to do with where the apphost was launched from.

@carlcamilleri
Copy link
Author

Thank you! Adding some more context of the terminal environment below, just in case it helps.

I have also verified that copying /usr/local/bin/podman-remote-static-linux_amd64 to /usr/local/bin/podman allows the Aspire application to run fine

machine_name:~/loremipsum/Product.AppHost$ alias
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alF'
alias ls='ls --color=auto'
alias podman='podman-remote-static-linux_amd64'

machine_name:~/loremipsum/Product.AppHost$ dotnet --version
8.0.303

machine_name:~/loremipsum/Product.AppHost$ dotnet workload list
Installed Workload Id      Manifest Version      Installation Source
--------------------------------------------------------------------
aspire                     8.2.0/8.0.100         SDK 8.0.300        

Use `dotnet workload search` to find additional workloads to install.


machine_name::~/loremipsum/Product.AppHost$ dotnet run
Building...
info: Aspire.Hosting.DistributedApplication[0]
      Aspire version: 8.2.0+75fdcff28495bdd643f6323133a7d411df71ab70
info: Aspire.Hosting.DistributedApplication[0]
      Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
      Application host directory is: ~/loremipsum/Product.AppHost
fail: Microsoft.Extensions.Hosting.Internal.Host[11]
      Hosting failed to start
      Aspire.Hosting.DistributedApplicationException: Container runtime 'podman' could not be found. The error from the container runtime check was: exec: "podman": executable file not found in $PATH
      failed to start podman command 'Info'.
      See https://aka.ms/dotnet/aspire/containers for more details on supported container runtimes.
         at Aspire.Hosting.Dcp.DcpDependencyCheck.EnsureDcpContainerRuntime(DcpInfo dcpInfo) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 205
         at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 110
         at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 130
         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. (Container runtime 'podman' could not be found. The error from the container runtime check was: exec: "podman": executable file not found in $PATH
failed to start podman command 'Info'.
See https://aka.ms/dotnet/aspire/containers for more details on supported container runtimes.)
 ---> Aspire.Hosting.DistributedApplicationException: Container runtime 'podman' could not be found. The error from the container runtime check was: exec: "podman": executable file not found in $PATH
failed to start podman command 'Info'.
See https://aka.ms/dotnet/aspire/containers for more details on supported container runtimes.
   at Aspire.Hosting.Dcp.DcpDependencyCheck.EnsureDcpContainerRuntime(DcpInfo dcpInfo) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 205
   at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 110
   at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDependencyCheck.cs:line 130
   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 311
   --- 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 339
   at Program.<Main>$(String[] args) in ~/loremipsum/Product/Product.AppHost/Program.cs:line 11

@dbreshears
Copy link

Unfortanetly you can't alias the command to be resovled correctly, podman will need to be part of the environment path.

@carlcamilleri
Copy link
Author

At the risk of being a pain, this means Aspire is unusable under the Podman installation instructions at https://podman-desktop.io/docs/podman/accessing-podman-from-another-wsl-instance

I’m guessing this is not an isolated case, so if it will not be supported I guess it needs to be documented

@davidfowl davidfowl transferred this issue from dotnet/aspire Sep 16, 2024
@davidfowl davidfowl reopened this Sep 16, 2024
@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label Sep 16, 2024
@davidfowl
Copy link
Member

Let's add this to the docs for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌚ Not Triaged Not triaged
Projects
None yet
Development

No branches or pull requests

4 participants