Host terminated unexpectedly! Volo.Abp.AbpInitializationException: An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module Volo.Abp.EventBus.Azure.AbpEventBusAzureModule, Volo.Abp.EventBus.Azure, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null: Value cannot be null. (Parameter 'topicName'). See the inner exception for details. ---> System.ArgumentNullException: Value cannot be null. (Parameter 'topicName') at Volo.Abp.Check.NotNull[T](T value, String parameterName) at Volo.Abp.AzureServiceBus.AzureServiceBusMessageConsumer.Initialize(String topicName, String subscriptionName, String connectionName) at Volo.Abp.AzureServiceBus.AzureServiceBusMessageConsumerFactory.CreateMessageConsumer(String topicName, String subscriptionName, String connectionName) at Volo.Abp.EventBus.Azure.AzureDistributedEventBus.Initialize() at Volo.Abp.EventBus.Azure.AbpEventBusAzureModule.OnApplicationInitialization(ApplicationInitializationContext context) at Volo.Abp.Modularity.AbpModule.OnApplicationInitializationAsync(ApplicationInitializationContext context) at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.InitializeAsync(ApplicationInitializationContext context, IAbpModule module) at Volo.Abp.Modularity.ModuleManager.InitializeModulesAsync(ApplicationInitializationContext context) --- End of inner exception stack trace --- at Volo.Abp.Modularity.ModuleManager.InitializeModulesAsync(ApplicationInitializationContext context) at Volo.Abp.AbpApplicationBase.InitializeModulesAsync() at Volo.Abp.AbpApplicationWithExternalServiceProvider.InitializeAsync(IServiceProvider serviceProvider) at Microsoft.AspNetCore.Builder.AbpApplicationBuilderExtensions.InitializeApplicationAsync(IApplicationBuilder app)
4 Answer(s)
-
0
- The exception is thrown by ABP Azure Service Bus distributed event bus initialization because ABP is trying to create an
AzureServiceBusMessageConsumerwith a nulltopicName:
AzureServiceBusMessageConsumer.Initialize(String topicName, String subscriptionName, String connectionName) ... ArgumentNullException: Value cannot be null. (Parameter 'topicName')So your host app is starting with
Volo.Abp.EventBus.Azureenabled, but the Azure EventBus TopicName is not configured (or not being read).- Fix: add (or correct) the Azure Service Bus EventBus configuration in the startup project that crashes (e.g.,
HttpApi.Host,AuthServer, etc.)appsettings.json/ environment-specific file:
{ "Azure": { "ServiceBus": { "Connections": { "Default": { "ConnectionString": "Endpoint=sb://<yournamespace>.servicebus.windows.net/;SharedAccessKeyName=...;SharedAccessKey=..." } } }, "EventBus": { "ConnectionName": "Default", "SubscriberName": "<YourApp_Subscriber>", "TopicName": "<YourTopicName>" } } }Notes (based on how ABP initializes the consumer):
Azure:EventBus:TopicNamemust be non-empty.Azure:EventBus:SubscriberNameis also required for subscriptions (keep it non-empty).Azure:EventBus:ConnectionNamemust match a key underAzure:ServiceBus:Connections.Also ensure you are not accidentally “losing” config values due to environment overrides:
- If you have
appsettings.Development.json,appsettings.Production.json, Kubernetes env vars, etc., confirm none of them overwriteAzure:EventBus:TopicNamewith an empty value. - Confirm you are running the correct project and it has the correct config file copied to output.
- If you have
If you don’t intend to use Azure Service Bus in this host, remove/disable the Azure event bus module from that host’s module dependencies (so
AbpEventBusAzureModuledoesn’t run). Otherwise ABP will always try to initialize it during application startup.
Sources (validated):
- https://abp.io/support/questions/2334
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
- The exception is thrown by ABP Azure Service Bus distributed event bus initialization because ABP is trying to create an
-
0
I am still getting below error. An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module Volo.Abp.EventBus.Azure.AbpEventBusAzureModule, Volo.Abp.EventBus.Azure, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null: Value cannot be null. (Parameter 'topicName'). See the inner exception for details. ---> System.ArgumentNullException: Value cannot be null. (Parameter 'topicName') below is my configuration
"Azure": { "ServiceBus": { "Connections": { "Default": { "ConnectionString": "" } } } }, "EventBus": { "ConnectionName": "Default", "SubscriberName": "email-subscription", "TopicName": "notification-event" }, "Abp": { "EventBus": { "Azure": { "TopicName": "notification-event", "SubscriptionName": "email-subscription", "ConnectionName": "Default" } } } -
0
Your JSON shows two different configuration shapes, but the one ABP’s Azure Event Bus expects is under
Azure:EventBus, not top-levelEventBus, and notAbp:EventBus:Azure(in your version/module).That’s why ABP still ends up with
topicName = nullat startup: it’s not reading the keys you think it is.
Use this exact section (and remove the others to avoid confusion):
{ "Azure": { "ServiceBus": { "Connections": { "Default": { "ConnectionString": "Endpoint=sb://...;SharedAccessKeyName=...;SharedAccessKey=..." } } }, "EventBus": { "ConnectionName": "Default", "SubscriberName": "email-subscription", "TopicName": "notification-event" } } }Then delete these sections entirely (they are not used by
Volo.Abp.EventBus.Azureinitialization and can mislead you during troubleshooting):"EventBus": { ... }, "Abp": { "EventBus": { "Azure": { ... } } }Also, in your posted config you have:
"ConnectionString": ""Even after fixing
TopicName, you will fail later because the connection string is empty. Put a real Azure Service Bus connection string there.If you want the host to start without Azure Service Bus at all (e.g., in local dev), you must remove the dependency on
Volo.Abp.EventBus.Azure/AbpEventBusAzureModulefrom that host; otherwise ABP will always try to initialize it on startup.(Validated reference relevant to Azure Service Bus EventBus config format used by ABP support)
- https://abp.io/support/questions/2334
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
-
0
hi
Please try to move
EventBusintoAzure.See https://abp.io/docs/latest/framework/infrastructure/event-bus/distributed/azure?_redirected=B8ABF606AA1BDF5C629883DF1061649A#appsettingsjson-file-configuration
{ "Azure": { "ServiceBus": { "Connections": { "Default": { "ConnectionString": "" } } }, "EventBus": { "ConnectionName": "", "SubscriberName": "", "TopicName": "" } } }Thanks.