Botframework-sdk: Urgent: Bot not responding

Created on 17 Oct 2016  路  11Comments  路  Source: microsoft/botframework-sdk

Hi my bot is not responding. It is setup with FB messenger.

Can the support team help in anyway.
I have checked my DB, server, debugged locally with emulator....it seems to be working fine.

Please help urgent! Can you check the logs.
What details should I provide here?

Most helpful comment

Hi @msft-shahins , you are my hero of the week.

Thanks a lot buddy!!!!!

All 11 comments

I checked Azure logs as well. It seems to be something in Bot.Connector service. See below:

  1. Checked Azure logs. See below the trace:

Buffer="{ "message": "An error has occurred.", "exceptionMessage": "Precondition Failed", "exceptionType": "Microsoft.Rest.HttpOperationException", "stackTrace": " at Microsoft.Bot.Connector.ErrorHandling.HandleError[ObjectT](HttpOperationResponse1 result)\r\n at Microsoft.Bot.Connector.BotStateExtensions.d__3.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.TaskAwaiter1.GetResult()\r\n at NaMoBot.MessagesController.<ReplyToUserMessage>d__7.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 NaMoBot.MessagesController.<Post>d__5.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.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__31.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.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.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.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.d__1.MoveNext()" }"`

I tried putting Try, Catch around the BotState code at each and every place in my code. But not no exception logged.

I even commented whole code and just wrote return of a simple text message. I logged that the message is received but it is not being sent back. Unable to identify the reason why. See below

public async Task<HttpResponseMessage> Post([FromBody]Activity activity) { ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl)); if (activity.Type == ActivityTypes.Message) { // return our reply to the user await connector.Conversations.ReplyToActivityAsync(activity.CreateReply("Sorry, I am down right now!")); } else { HandleSystemMessage(activity); } var response = Request.CreateResponse(HttpStatusCode.OK); return response; }

Please help/suggest what should I do?

Is it responding with a dummy fb account ? Watch out, sometimes facebook flag your messages as "spam messages" and the bot can't see them anymore

No, it is not responding to any FB account. Actually I have commented my whole code & kept just a simple text reply. Now the message gets received from FB page to my endpoint but the reply isn't sent.
I am not able to capture any error whatsoever.

Take a look at some of the other issues with the "Precondition Failed" error: https://github.com/Microsoft/BotBuilder/issues?q=Precondition%20Failed

Thanks for the reply @danmarshall . But i have commented my whole code and kept just a simple 'text reply'. Even then I am not getting any reply.

Is there any way you can check any logs if I provide you the AppId. May be you can point any error I am not able to see.

Please help as my bot is live and users are not able to communicate. I am in deep trouble.

Can you provide your AppID and if possible, a code sample.

Sorry I meant I need your Bot id from your Bot Framework registration.

@afficionaddo I looked at the logs for your bot and see this in our logs:

Facebook graph API call failed with: BadRequest {"error":{"message":"Error validating access token: The session has been invalidated because the user has changed the password.","type":"OAuthException","code":190,"error_subcode":460,"fbtrace_id":"BrS8P06B9CO"}

have you changed your password recently? I guess facebook will invalidate the page access token after a password change and you need to update your page access token in botframework. If you debug your bot, you should see that you calls to botframework are failing with that error from facebook.

Hi @msft-shahins , you are my hero of the week.

Thanks a lot buddy!!!!!

Thank you @msft-shahins - you are now my hero of the week.

Was this page helpful?
0 / 5 - 0 ratings