Azure / azure-event-hubs-emulator-installer

This repository acts as a central hub for handling issues, collecting feedback, and facilitating discussions related to the Azure Event Hubs emulator.
https://learn.microsoft.com/azure/event-hubs/overview-emulator
MIT License
17 stars 6 forks source link

Errors when starting the emulator in Podman #21

Open kacety123 opened 2 weeks ago

kacety123 commented 2 weeks ago

Hi all,

Currently attempting to run this emulator on Podman desktop v 1.10.3 via Windows

After getting the containers up in podman and starting the run, the errors attached are received in the emulator logs:

PlatformNotSupportedException and NullReferenceException

Have attempted to uninstall and completely reinstall everything from podman through to the emulator. No success. Unable to replicate the issue on another machine so far.

(sorry this thing won't let me input my screenshot of the errors)

krishankumar95 commented 2 weeks ago

@kacety123 ; Can you please share the console logs and file logs from the container at:

/home/app/EmulatorLogs/*.log

Also need few more details: a) Windows Version b) WSL Version
c) Emulator launch method.

If you are launching via the default bundling Windows script (LaunchEmulator.ps1) it requires updating few commands as: Following docker compose commands change to podman compose commands :

docker compose -f $composeFile down
docker compose -f $composeFile up -d
podman compose -f $composeFile down
podman compose -f $composeFile up -d

With the above changes Emulator should launch successfully :

image

kacety123 commented 2 weeks ago

Hi yes so no success at getting the logs from the file but here is the information you were asking for:

Windows 11 22H2 Wsl version is 2 Launch method: docker

Logs from the emulator running:

[12:38:45 WRN] <Trc Id="60006" Ch="Debug" Lvl="Warning" Kw="1000000000011110" UTC="2024-06-27T12:38:45.748Z" Msg="An exception was handled at TenantCacheComponent.OnEndRefresh. Exception message ExceptionId: 4e48e70c-55c1-4a17-8431-c0c92acce328-System.NullReferenceException: Object reference not set to an instance of an object.&#xA;   at a.a.aaX.z(IAsyncResult)." />
[12:38:45 WRN] <Trc Id="60000" Ch="Operational" Lvl="Warning" Kw="4000000000011110" UTC="2024-06-27T12:38:45.785Z" Msg="Exception occurred while creating performance counters. Exception message &amp;apos;System.PlatformNotSupportedException: Performance Counters are not supported on this platform.&#xA;   at System.Diagnostics.PerformanceData.CounterSet..ctor(Guid providerGuid, Guid counterSetGuid, CounterSetInstanceType instanceType)&#xA;   at h.hM.ad()&#xA;   at h.hM.ab()&#xA;   at h.hh.A(PerformanceCounterLevel)&amp;apos;." />
[12:38:46 WRN] <Trc Id="60000" Ch="Operational" Lvl="Warning" Kw="4000000000011110" UTC="2024-06-27T12:38:46.803Z" Msg="Exception occurred while creating performance counters. Exception message &amp;apos;System.PlatformNotSupportedException: Performance Counters are not supported on this platform.&#xA;   at System.Diagnostics.PerformanceData.CounterSet..ctor(Guid providerGuid, Guid counterSetGuid, CounterSetInstanceType instanceType)&#xA;   at h.hK.ab()&#xA;   at h.hh.A(PerformanceCounterLevel)&amp;apos;." />
[12:38:46 WRN] <Trc Id="60000" Ch="Operational" Lvl="Warning" Kw="4000000000011110" UTC="2024-06-27T12:38:46.835Z" Msg="Exception occurred while creating performance counters. Exception message &amp;apos;System.PlatformNotSupportedException: Performance Counters are not supported on this platform.&#xA;   at System.Diagnostics.PerformanceData.CounterSet..ctor(Guid providerGuid, Guid counterSetGuid, CounterSetInstanceType instanceType)&#xA;   at h.hK.ab()&#xA;   at h.hh.A(PerformanceCounterLevel)&amp;apos;." />
[12:38:46 WRN] <Trc Id="60006" Ch="Debug" Lvl="Warning" Kw="1000000000011110" UTC="2024-06-27T12:38:46.848Z" Msg="An exception was handled at TenantCacheComponent.OnEndRefresh. Exception message ExceptionId: 6ccf5f5f-2982-4f7f-af62-b362db018d3e-System.NullReferenceException: Object reference not set to an instance of an object.&#xA;   at a.a.aaX.z(IAsyncResult)." />
[12:38:46 WRN] <Trc Id="60000" Ch="Operational" Lvl="Warning" Kw="4000000000011110" UTC="2024-06-27T12:38:46.987Z" Msg="Exception occurred while creating performance counters. Exception message &amp;apos;System.PlatformNotSupportedException: Performance Counters are not supported on this platform.&#xA;   at System.Diagnostics.PerformanceData.CounterSet..ctor(Guid providerGuid, Guid counterSetGuid, CounterSetInstanceType instanceType)&#xA;   at h.hp.ac()&#xA;   at h.hp.ab()&#xA;   at h.hh.A(PerformanceCounterLevel)&amp;apos;." />
krishankumar95 commented 2 weeks ago

@kacety123 ; PlatformNotSupportedException and NullReferenceException are internal warnings and should not impact the Emulator runtime.

In the console logs there will be following (From the Emulator container in Podman):

info: a.a.aap[0]
      Emulator Service is Launching On Platform:CBL-Mariner/Linux,X64
info: a.a.aap[0]
      Instantiating service components
info: a.a.aap[0]
      Creating namespace, entities and consumer groups
info: a.a.aaW[0]
      Emulator is launching with config : {"LoggingConfig":{"Type":"File"},"NamespaceConfig":[{"Type":"EventHub","Name":"emulatorns1","Entities":[{"Name":"eh1","PartitionCount":2,"ConsumerGroups":[{"Name":"cg1"},{"Name":"$default"}]},{"Name":"eh2","PartitionCount":2,"ConsumerGroups":[{"Name":"cg2"},{"Name":"$default"}]}]}]}
info: a.a.aap[0]
      Emulator Service is Successfully Up! ; Use connection string : "Endpoint=sb://localhost;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;"

You can trying doing a Send-Receive with the bundled C# sample or any other official Event Hub SDK for other languages.

krishankumar95 commented 2 weeks ago

@kacety123 ; Additionally while launching via direct docker/podman compose , following environment variable needs to be specified either as Full Path or Relative to the compose.yaml.

   volumes:
      - "${CONFIG_PATH}:/Eventhubs_Emulator/ConfigFiles/Config.json"

If this is not specified Emulator defaults to its internal logging and entity configuration. When initialised correctly these warning log lines will not be pushed to console and useful info level logs will pop up around Emulator launch.

Sample config file can be found here : https://github.com/Azure/azure-event-hubs-emulator-installer/blob/main/EventHub-Emulator/Config/Config.json

krishankumar95 commented 3 days ago

@kacety123 ; Any updates here? Were you able to run the sample send receive application.