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.

Exception: invalid need: expected Wait, have Done

See original GitHub issue

I receive exception in emulator, when doing EchoBot with Bot Builder exactly as shown in documentation. (EchoDialog is copy pasted)

Message and stack-trace are not very informative. I can’t understand what exactly is wrong in my code.

The same project works well if I do it without Bot Builder.

{
  "message": "An error has occurred.",
  "exceptionMessage": "invalid need: expected Wait, have Done",
  "exceptionType": "Microsoft.Bot.Builder.Internals.Fibers.InvalidNeedException",
  "stackTrace": "   в Microsoft.Bot.Builder.Internals.Fibers.Wait`1.ValidateNeed(Need need)\r\n   в Microsoft.Bot.Builder.Internals.Fibers.Wait`1.Microsoft.Bot.Builder.Internals.Fibers.IWait.Post[D](D item)\r\n   в Microsoft.Bot.Builder.Internals.Fibers.Extensions.Post[T](IFiber fiber, T item)\r\n   в Microsoft.Bot.Builder.Dialogs.Internals.DialogContext.<Microsoft-Bot-Builder-Dialogs-Internals-IUserToBot-SendAsync>d__20.MoveNext()\r\n--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---\r\n   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   в Microsoft.Bot.Builder.Dialogs.Conversation.<SendAsync>d__2.MoveNext()\r\n--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---\r\n   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   в Bot.Controllers.MessagesController.<Post>d__0.MoveNext() в C:\\work\\TsyaBot\\Bot\\Controllers\\MessagesController.cs:строка 22\r\n--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---\r\n   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   в System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.MoveNext()\r\n--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---\r\n   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   в System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---\r\n   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   в System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---\r\n   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   в System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()\r\n--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---\r\n   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   в System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}

Issue Analytics

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

github_iconTop GitHub Comments

7reactions
willportnoycommented, Apr 3, 2016

Try starting a new conversation by changing the conversation ID. You would see this exception if your code finished without calling something like context.Wait(MessageReceived). We’ll work to improve the error message.

0reactions
poojashivachcommented, Aug 21, 2017

@nornes : can you let me know how you have resolved the above issue??

I am also using AuthBot package for authentication, and my bot flow is similar to yours.

When access token is not present after authentication I get the same error as you i.e. Exception: invalid need: expected Wait, have Call.

Thanks in advance!

Read more comments on GitHub >

github_iconTop Results From Across the Web

I get exception when using Thread.sleep(x) or wait()
The same error message appears: unreported exception java.lang.InterruptedException; must be caught or declared to be thrown. Is there any step required before ...
Read more >
Top 10 Selenium Exceptions and How To Handle These ...
Add a wait command and try to avoid an exception; Use 'Try/Catch' to handle in case if a truly exceptional case has occurred....
Read more >
Understanding ExpectedConditions in Selenium - BrowserStack
Understand how to use 7 different types of ExpectedConditions in Selenium with code examples to check if all elements present are visible.
Read more >
How can I troubleshoot AWS Config console error messages?
Follow these troubleshooting steps for the specific AWS Config console error message. ... This error can occur if the AWS Identity and Access ......
Read more >
Common Error Messages for CDS Requests
the request you have submitted is not valid. Client has not agreed to the required terms and conditions. Invalid 'method': cds.catalogue.
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