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-hosted containers may not be able to reach Aspire services #4136

Open
timheuer opened this issue May 9, 2024 · 6 comments
Open

Podman-hosted containers may not be able to reach Aspire services #4136

timheuer opened this issue May 9, 2024 · 6 comments
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication area-orchestrator bug Something isn't working external Issues that represent work that's external to this repo. podman Issues related to using Podman for dev-time container management
Milestone

Comments

@timheuer
Copy link
Member

timheuer commented May 9, 2024

Using the HealthChecksUI sample in the dotnet/aspire-samples repo and Podman, the HealthChecks UI dashboard was not able to reach the healthchecks URIS:

Image

with looking at the logs exceptions:

GetHealthReport threw an exception when trying to get report from http://host.containers.internal:61669/healthz configured with name webfrontend.
      System.Net.Http.HttpRequestException: Connection refused (host.containers.internal:61669)
       ---> System.Net.Sockets.SocketException (111): Connection refused

This appears to be a common issue with Podman 5+ presently: containers/podman#22237

This operates differently when just using Docker and the host.docker.internal URIs don't seem to be impacted, but Podman and the mappings used in the Podman machine network config seem to impact these situations where a container needing to accessing something at the host.containers.internal URI may fail given this issue.

@DamianEdwards DamianEdwards added area-orchestrator area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication and removed area-dashboard labels May 9, 2024
@dbreshears dbreshears added external Issues that represent work that's external to this repo. podman Issues related to using Podman for dev-time container management labels Jun 3, 2024
@NikiforovAll
Copy link

The issue also reproduces when I attempt to access Postgres using PgAdmin. Is there a possible workaround for this problem?


Context:
Podman Desktop for my Windows 10 machine using WSL

@karolz-ms
Copy link
Member

Putting on backlog since this is mostly an external Podman issue.

@NikiforovAll I cannot think of a simple workaround at the moment, sorry.

@mitchdenny
Copy link
Member

Related: #5510

@arielmoraes
Copy link

arielmoraes commented Sep 4, 2024

@karolz-ms I'm having a similar issue when trying to make Docker containers reach the host projects. The Aspire proxy does not seem to listen on all interfaces causing a Connection Refused:

image

The only working IP is 127.0.0.1 as expected, but when using host.docker.internal you can have two scenarios:

  1. When accessing host.docker.internal from the host itself it resolves to the machine's IP address (default configuration)
  2. When accessing from a container it resolves to the host IP associated with the Docker network

So the request won't be accepted if the Aspire proxy does not listen on all interfaces.

@karolz-ms
Copy link
Member

@arielmoraes correct. Aspire proxy listens on localhost-related interfaces by default.

@mitchdenny @davidfowl I was going to follow with "you can add an Endpoint with a host address that refers to the Docker bridge network" but I noticed that the EndpointAnnotation does not have an "address" property. So it does not seem possible from the app model to bind to arbitrary (host) network interface. Am I correct, and if yes, is this something we should enable?

@davidfowl
Copy link
Member

This is a container to host problem that we need to figure out how to address that problem in both WSL and podman.

@davidfowl davidfowl added the bug Something isn't working label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication area-orchestrator bug Something isn't working external Issues that represent work that's external to this repo. podman Issues related to using Podman for dev-time container management
Projects
None yet
Development

No branches or pull requests

8 participants