botbuilder-js: DialogContextError in botbuilder-dialogs

Github issues should be used for bugs and feature requests. Use Stack Overflow for general “how-to” questions.

Versions

package version of the SDK: ^4.7.0 node.js version: v12.13.1 browser version: Chrome 87 os: Windows 10 bot written in Typescript 3.9.7

Describe the bug

The user is stuck in a weird dialog state and cannot interact with the bot anymore, receiving only the “Sorry, it looks like something went wrong.” error message. The implemented interruption logic (CancelDialog) is not working either. User’s last successful conversation with the bot ended the current dialog, so the user is not stuck in a previous conversation.

Here are some useful stack traces from the logs:

DialogContextError_MainDialog

DialogContextError_DialogContext

And the actual stringified error here:

DialogContextError

Analyzing the stack trace, here’s the error that’s being thrown in the /botbuilder-dialogs/lib/dialogContext.js:

throw new dialogContextError_1.DialogContextError(DialogContext.continueDialog(): Can’t continue dialog. A dialog with an id of ‘${instance.id}’ wasn’t found., this);

Here is the code for the dialogBot.ts where the error is being thrown (in turn method) and mainDialog.ts where a dialog is started based on the detected skill of the bot.

https://github.com/StefaniaMan314/botbuilder

To Reproduce

Every time the user tries to start a new conversation with the bot a DialogContextError is being thrown and the dialog cannot be started.

Expected behavior

The dialog to start is found in the dialog context or in its parent dialog context.

Screenshots

Here’s a screenshot of the user’s conversations and the bot’s responses:

teams_chatbot_conversation

Additional context

The odd thing is that this is happening only for a few users (3) across the org (from a total of ~5000 users). This is an unprecedented issue.

Here are several ways we tried to solve this, but none of them worked:

  • Clearing state DB entries for this user
  • Uninstalling and installing back the bot in Teams
  • Clearing Teams cache on the user’s machine

Any help is greatly appreciated. Thank you!

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

We found a way to clear the conversationId in our botstate db. The issue was solved for the users, we can close this, thanks!

onEvent is triggered when the user performs an action submitted from an AC (for example clicking a button). The main thing that’s happening here is that dc.continueDialog() is being called, and if the status of the dialog turn result is complete, it calls the complete() method that clears the skill status.

You can ignore the TokenResponseEventName check, as I debugged the code and it never passes this condition . It must be a reminiscent code from an older version of the project.

I will add more logs across the project to identify bot state elements such as the conversationId that could help me track the user’s interaction in our state database and understand what’s happening. Thanks!