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.67k stars 419 forks source link

Container for Azure EventHubs emulator fails to startup successfully in Podman #5097

Closed jbparker closed 1 week ago

jbparker commented 1 month ago

Is there an existing issue for this?

Describe the bug

The local EventHubs emulator does not startup successfully when using the Aspire.Hosting.Azure.EventHubs extension method RunAsEmulator().

Two containers (eventhub and eventhub-storage) are started, but the eventhub container fails with the message Emulator Start up probe Unsuccessful. MetadataStore Health status: Unhealthy BlobStore Health status: Unhealthy.

After failing the health checks, the event hub container eventually exits:

podman-containers

Expected Behavior

EventHubs containers created by Aspire hosting should start, pass health checks, and be accessible for Aspire component usage.

Steps To Reproduce

https://github.com/jbparker/AspireEventHub

Forked from https://github.com/davidfowl/AspireEventHub and updated to use Event Hubs emulator from https://github.com/dotnet/aspire/issues/3412

Exceptions (if any)

The event hub container (eventhubns) logs health check errors:

fail: a.a.aaW[0] Emulator Start up probe Unsuccessful. MetadataStore Health status: Unhealthy BlobStore Health status: Unhealthy fail: Microsoft.Extensions.Diagnostics.HealthChecks.DefaultHealthCheckService[103] Health check Emulator Health Check with status Unhealthy completed after 27907.2647ms with message 'Emulator Start up probe Unsuccessful. MetadataStore Health status: Unhealthy BlobStore Health status: Unhealthy' Retry 1 encountered an exception: Emulator Health Check failed.. Waiting 00:00:00 before next retry. ... (meanwhile, after 2nd retry) An error occurred: Emulator Health Check failed.

Naturally, the EventHubsConsumer and EventHubsApi projects throw exceptions trying to access the emulated Event Hubs namespace.

Of note, the storage container (eventhubns-storage) has logs that show it was able to start successfully:

Azurite Blob service is starting at http://0.0.0.0:10000 Azurite Blob service is successfully listening at http://0.0.0.0:10000 Azurite Queue service is starting at http://0.0.0.0:10001 Azurite Queue service is successfully listening at http://0.0.0.0:10001 Azurite Table service is starting at http://0.0.0.0:10002 Azurite Table service is successfully listening at http://0.0.0.0:10002

.NET Version info

.NET SDK: 8.0.303 Workloads: Aspire 8.1.0/8.0.100 Runtime environment: Windows, 10.0.22631 .NET runtimes: Microsoft.AspNetCore.App 8.0.7, Microsoft.NETCore.App 8.0.7, Microsoft.WindowsDesktop.App 8.0.7

Anything else?

I'm unsure if this is an issue with using Podman or something dealing directly with Azurite/etc and not Aspire.

Using:

davidfowl commented 2 weeks ago

Same as https://github.com/dotnet/aspire/pull/4192

davidfowl commented 2 weeks ago

See https://github.com/dotnet/aspire/issues/5584

davidfowl commented 1 week ago

5584