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.

LuisDialog returns error after BotAddedToConversation to any message

See original GitHub issue

Hi after I successfully have my response from BotAddedToConversation message I have the following error displayed as a response in my simulator;

{
    "message": "An error has occurred.",
    "exceptionMessage": "invalid need: expected Wait, have Done",
    "exceptionType": "Microsoft.Bot.Builder.Internals.Fibers.InvalidNeedException",
    "stackTrace": "   at Microsoft.Bot.Builder.Internals.Fibers.Wait`1.ValidateNeed(Need need)\r\n   at Microsoft.Bot.Builder.Internals.Fibers.Wait`1.Microsoft.Bot.Builder.Internals.Fibers.IWait.Post[D](D item)\r\n   at Microsoft.Bot.Builder.Internals.Fibers.Extensions.Post[T](IFiber fiber, T item)\r\n   at Microsoft.Bot.Builder.Dialogs.Internals.DialogContext.<Microsoft-Bot-Builder-Dialogs-Internals-IUserToBot-SendAsync>d__20.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Bot.Builder.Dialogs.Conversation.<SendAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at MyApp.MessagesController.<Post>d__0.MoveNext() in C:\\dev\\projects\\other\\msusur\\jupi-bot\\Jupi.App\\Controllers\\MessagesController.cs:line 28\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}

here is my luis dialog. What might go wrong?

    [LuisModel("my model id", "subscription key")]
    [Serializable]
    public class MyQueryDialog : LuisDialog
    {
        [LuisIntent("LoadLinks")]
        public async Task ProcessLinkRequest(IDialogContext context, LuisResult result)
        {
            var entities = new List<EntityRecommendation>(result.Entities);
            if (entities.Count == 0)
            {
                await context.PostAsync("Thank you!");
            }
            context.Wait(MessageReceived);
        }
    }

Here is how I handle the messages

public async Task<Message> Post([FromBody]Message message)
        {
            if (message.Type == "Message")
            {
                return await Conversation.SendAsync(message, () => new MyQueryDialog(BuildForm));
            }
            return HandleSystemMessage(message);
        }

   private static IForm<QueryModel> BuildForm()
        {
            var builder = new FormBuilder<QueryModel>();

            return builder.AddRemainingFields().Build();
        }

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
willportnoycommented, Apr 12, 2016

It’s the ID that shows up the LUIS query url - the website will provide it to you.

        queryString["id"] = this.model.ModelID;
        queryString["subscription-key"] = this.model.SubscriptionKey;
        queryString["q"] = text;
0reactions
rodzillarrcommented, Apr 13, 2016

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

LuisDialog returns error after BotAddedToConversation to any ...
Hi after I successfully have my response from BotAddedToConversation message I have the following error displayed as a response in my ...
Read more >
LuisDialog returns an InvalidIntentHandlerException every time
When I replaced every reference of LuisServiceResult to LuisResult, the error went away and my intent methods came into play.
Read more >
Messages in bot conversations - Teams | Microsoft Learn
Learn how to send receive a message, suggested actions, notification, attachments, images, Adaptive Card and status error code responses.
Read more >
botframework-sdk from microsoft - Giter VIP
When the SandwichOrder Form is completed I'd like to store the order. I didn't find any code in the sample where I could...
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