-
Notifications
You must be signed in to change notification settings - Fork 802
Open
Open
Copy link
Labels
area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Note: This behaviour does not occur with Intel windows, only ARM64 (afaict)
Health checks only go over ipv6, while docker desktop defaults to only using ipv4, making the aspire network inaccessible.
Expected Behavior
Health checks should try ipv6 and ipv4.
Steps To Reproduce
requires WoA (windows on arm) to repro:
I used this apphost to show that the health check fails but the http port is reachable within an event handler using a vanilla httpclient:
using System.Net.Http.Headers;
var builder = DistributedApplication.CreateBuilder(args);
#pragma warning disable ASPIREPROXYENDPOINTS001
var openfga = builder.AddContainer("openfga", "openfga/openfga:latest")
.WithEnvironment(e =>
{
e.EnvironmentVariables.Add("OPENFGA_DATASTORE_ENGINE", "memory");
e.EnvironmentVariables.Add("OPENFGA_PLAYGROUND_ENABLED", "true");
})
.WithEndpoint(
targetPort: 8080,
name: "http",
scheme: "http"
)
//.WithEndpoint("http", (ep) => ep.TargetHost = "127.0.0.1") // uncomment this to force IPv4
.WithArgs("run")
.WithLifetime(ContainerLifetime.Persistent)
.WithHttpHealthCheck(path: "/healthz", statusCode: 200, endpointName: "http")
.WithEndpointProxySupport(proxyEnabled: false);
#pragma warning restore ASPIREPROXYENDPOINTS001
openfga.OnResourceEndpointsAllocated(async (r, e, c) =>
{
var http = r.GetEndpoint("http");
{
retry:
try
{
Console.WriteLine($"OpenFGA {http.EndpointName} Endpoint: {http.Url}");
using HttpClient client = new() { BaseAddress = new Uri(http.Url) };
var res = await client.GetAsync("/healthz");
res.EnsureSuccessStatusCode();
var content = await res.Content.ReadAsStringAsync();
Console.WriteLine($"OpenFGA {http.EndpointName} /healthz: {content}");
}
catch (Exception ex)
{
Console.WriteLine($"OpenFGA {http.EndpointName} {ex.GetType().Name}: {ex.Message}, retrying...");
await Task.Delay(1000);
goto retry;
}
}
});
builder. Build().Run();Exceptions (if any)
TaskCanceledException is throw for the healthcheck, almost immediately.
.NET Version info
tried net8, net10
Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication