Error message is not shown when the bot fails to start
See original GitHub issueDescribe the bug
I am testing what happens when you create a bot containing an infinite loop of dialogs calling each other. (See attachment below in the Additional context section.) My testing is successful: the bot fails to start (even though not with the friendliest of error messages, but that’s another, less important topic). But I am facing an issue while doing this: the Composer is not able to display the error message the runtime produces on failure. Nothing indicates that the bot failed to start (apart from the 400 error code I get in the Emulator when I try to chat with the bot), everything looks like the bot started just fine. I am only able to make the error popup visible by navigating to another page of the Composer (Settings, Home, etc.) then navigating back to the Design page. (See gif below in the Screenshots section.) But even then, the popup shows up quite randomly, I can’t really connect it’s behavior to any concrete action I take. I don’t know if this has to do with the bot configuration I am trying to test (hence the exported zip file below to fully reproduce the issue) or this is the current behavior in 1.2 for any error coming from the runtime on startup failure.
Version
1.2.1
Browser
- Electron distribution
- Chrome
- Safari
- Firefox
- Edge
OS
- macOS
- Windows
- Ubuntu
To Reproduce
Steps to reproduce the behavior:
- Open the attached bot.
- Start the bot.
- Observe that it seems the bot started correctly. Connect with the Emulator to see that in fact, it did not:
{ "error": { "code": "ServiceError", "message": "request to http://localhost:3979/api/messages failed, reason: connect ECONNREFUSED 127.0.0.1:3979" } }
- Navigate to a different page of the Composer (Settings, Home, etc.) then back to the Design page to make the error popup appear.
Expected behavior
The error popup should appear as soon as the bot failed to start and the Composer should not offer to test the bot in the Emulator. Just like it was working in version 1.1.1.
Screenshots
Additional context
Bot
Error message
Start bot failed
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialog.EnsureDependenciesInstalled() at Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialog.GetDependencies()+MoveNext() at Microsoft.Bot.Builder.Dialogs.DialogSet.Add(Dialog dialog) at Microsoft.Bot.Builder.Dialogs.DialogSet.Add(Dialog dialog) at Microsoft.Bot.Builder.Dialogs.DialogSet.Add(Dialog dialog) at Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialog.EnsureDependenciesInstalled() at Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialog.GetDependencies()+MoveNext() at Microsoft.Bot.Builder.Dialogs.DialogSet.Add(Dialog dialog) at Microsoft.Bot.Builder.Dialogs.DialogSet.Add(Dialog dialog) at Microsoft.Bot.Builder.Dialogs.DialogSet.Add(Dialog dialog) at Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialog.EnsureDependenciesInstalled() at Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialog.GetDependencies()+MoveNext() at Microsoft.Bot.Builder.Dialogs.DialogSet.Add(Dialog dialog) at Microsoft.Bot.Builder.Dialogs.DialogSet.Add(Dialog dialog) at Microsoft.Bot.Builder.Dialogs.DialogSet.Add(Dialog dialog) at Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialog.EnsureDependenciesInstalled() at Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialog.GetDependencies()+MoveNext() at Microsoft.Bot.Builder.Dialogs.DialogSet.Add(Dialog dialog) at Microsoft.Bot.Builder.Dialogs.DialogSet.Add(Dialog dialog) at Microsoft.Bot.Builder.Dialogs.DialogSet.Add(Dialog dialog) at Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialog.EnsureDependenciesInstalled() at Microsoft.Bot.Builder.Dialogs.Adaptive.AdaptiveDialog.GetDependencies()+MoveNext() at Microsoft.Bot.Builder.Dialogs.DialogSet.Add(Dialog dialog) at Microsoft.Bot.Builder.Dialogs.DialogManager.set_RootDialog(Dialog value) at Microsoft.Bot.Builder.Dialogs.DialogManager..ctor(Dialog rootDialog, String dialogStateProperty) at Microsoft.BotFramework.Composer.Core.ComposerBot.LoadRootDialogAsync() in C:\Users\peter\AppData\Roaming\BotFrameworkComposer\hostedBots\76270.46833883511\runtime\core\ComposerBot.cs:line 64 at Microsoft.BotFramework.Composer.Core.ComposerBot..ctor(ConversationState conversationState, UserState userState, ResourceExplorer resourceExplorer, BotFrameworkClient skillClient, SkillConversationIdFactoryBase conversationIdFactory, IBotTelemetryClient telemetryClient, String rootDialog, String defaultLocale, Boolean removeRecipientMention) in C:\Users\peter\AppData\Roaming\BotFrameworkComposer\hostedBots\76270.46833883511\runtime\core\ComposerBot.cs:line 43 at Microsoft.BotFramework.Composer.WebAppTemplates.Startup.<>c__DisplayClass13_0.<ConfigureServices>b__5(IServiceProvider s) in C:\Users\peter\AppData\Roaming\BotFrameworkComposer\hostedBots\76270.46833883511\runtime\azurewebapp\Startup.cs:line 194 at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType) at Microsoft.Bot.Builder.Integration.AspNet.Core.ApplicationBuilderExtensions.UseNamedPipes(IApplicationBuilder applicationBuilder, String pipeName, String audience) at Microsoft.BotFramework.Composer.WebAppTemplates.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env) in C:\Users\peter\AppData\Roaming\BotFrameworkComposer\hostedBots\76270.46833883511\runtime\azurewebapp\Startup.cs:line 211 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder) at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder) at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass13_0.<UseStartup>b__2(IApplicationBuilder app) at Microsoft.ApplicationInsights.AspNetCore.ApplicationInsightsStartupFilter.<>c__DisplayClass2_0.<Configure>b__0(IApplicationBuilder app) at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder) at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app) at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host) at Microsoft.BotFramework.Composer.WebAppTemplates.Program.Main(String[] args) in C:\Users\peter\AppData\Roaming\BotFrameworkComposer\hostedBots\76270.46833883511\runtime\azurewebapp\Program.cs:line 16
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (7 by maintainers)
Top GitHub Comments
After deep investigation, we found there is a minor bug in composer SDK runtime that caused the loop detection failed when loading loop dialogs. The short term fix in composer side is one line code change here https://github.com/microsoft/BotFramework-Composer/pull/5077. The long term fix should be in SDK side. I created an issue in SDK side https://github.com/microsoft/botbuilder-dotnet/issues/5021 to track this.
@peterbozso sorry for the late response. Before this is fixed in our side, you can take below work-around stpes:
var rootDialog = resourceExplorer.LoadType<AdaptiveDialog>(rootFile);
) withvar rootDialog = resourceExplorer.LoadType<Dialog>(rootFile);
. Build the runtime project.Thanks, Fei
@peterbozso it is not in 1.2.1 yet, you can try the nightly build instead, we will release that in 1.3. @feich-ms is help debugging on the object reference to null issue, will update this thread later.