Windows ARM64: Health checks are performed over IPv6 only, while docker defaults to IPv4
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] 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:
```csharp
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_
Contributor guide
Assessment
This issue has not been assessed yet.