question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error message is not shown when the bot fails to start

See original GitHub issue

Describe 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:

  1. Open the attached bot.
  2. Start the bot.
  3. 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"
      }
    }
    
  4. 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

errorstart

Additional context

Bot

LoopProtectBot_export.zip

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:closed
  • Created 3 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
feich-mscommented, Dec 3, 2020

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:

  1. Eject your runtime. See below screenshot to get a copy of your runtime image
  2. You will find a runtime folder generated in your bot root folder. Go into the folder and open the file ComposerBot.cs in Core subfolder. Change line 69 (var rootDialog = resourceExplorer.LoadType<AdaptiveDialog>(rootFile);) with var rootDialog = resourceExplorer.LoadType<Dialog>(rootFile);. Build the runtime project.
  3. Go back to composer to start bot, you will see no exceptions and the bot can work as exptected.

Thanks, Fei

1reaction
luhan2017commented, Dec 2, 2020

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I can not launch my js Discord bot, error message
It looks like you are trying to run v12.5.3 code when you have discord.js v13, that's why you get this error, it's missing...
Read more >
Troubleshoot Your Bot - Salesforce Help
From the Bot Builder menu, click Performance. · To review bot activity, display the Events Log tab. · To drill into the session,...
Read more >
Question Detail - Automation Anywhere aPeople
I just made the bot for display of message. i get this preprocessing.failure error every time i run the bot. i just installed...
Read more >
Troubleshoot issues in Omnichannel for Customer Service
A message stating Sorry, we're not able to serve you at the moment is shown to the customers when they start a chart...
Read more >
reCAPTCHA Help - Google Support
If your answer is incorrect, you will be presented with another audio challenge. audio challenge after a failed attempt, the focus is set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found