botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Registering Bot on Facebook Messenger shows Error as Status with no Details

Open varunsethnsit opened this issue 10 years ago • 13 comments

I am registering my bot (created through Microsoft's bot Developer framework) on Facebook Messenger, however, after successful authentication, I am receiving an error as the status with no details. Any pointers please ?

varunsethnsit avatar May 12 '16 04:05 varunsethnsit

I'd like to second the report above. Below are the steps I took:

-Created a bot using vanilla solution from the blog. -Deployed it to azure websites. -Tested chat using chat emulator (with deployed site) and it worked fine. -registered bot on FB Messenger as a app, tied it with fb page exactly as per instructions. -authenticated app with FB successfully. -started sending messages to page and kept getting "Method not allowed" as per screenshot. -Enabled/disabled [BotAuthentication], re-deployed and tested but same result. -Tried with/without HTTPS still same result. -Checked Operation Logs to see a rule appear under ALERT called "ForbiddenRequests {appname}"

Please advise next steps?

botfail

chitrang89 avatar May 12 '16 10:05 chitrang89

Adding further to above, just tried to integrate with Slack which went through fine but when I talk to the bot, it returns the same message as above. Either I am doing something fundamentally wrong or it may be a bug? Please advise.

chitrang89 avatar May 12 '16 22:05 chitrang89

Your web service is rejecting POST as a method. This is either because you are not configured to allow POST or there is something in between which is blocking POST (like a proxy server)

Try doing a POST directly to your service using a tool like POSTMAN (chrome)

tomlm avatar May 12 '16 23:05 tomlm

Hi Tom,

Thanks for your response :+1: I tried several environments and checked firewall, CORS etc, still no go :( Any further suggestions?

Much appreciate you looking into this.

Chitrang

chitrang89 avatar May 16 '16 04:05 chitrang89

This is happening for me. All of my other channels are working correctly but Facebook is still showing as "Error"

DavePilks avatar May 20 '16 11:05 DavePilks

Please include your botid with your communications so we can better assist you.

tomlm avatar May 20 '16 17:05 tomlm

@tomlm my botid is roboadvisorprototype

DavePilks avatar May 20 '16 18:05 DavePilks

BTW: If you add an application insights key to your bot registration we will log these events and you will be able to see them.

Your bot is throwing an exception.

"exceptionMessage": "invalid need: expected Wait, have Done", "exceptionType": "Microsoft.Bot.Builder.Internals.Fibers.InvalidNeedException", "stackTrace": " at Microsoft.Bot.Builder.Internals.Fibers.Wait1.ValidateNeed(Need need) at Microsoft.Bot.Builder.Internals.Fibers.Wait1.Microsoft.Bot.Builder.Internals.Fibers.IWait.Post[D](D item) at Microsoft.Bot.Builder.Dialogs.Internals.DialogContext.d__20`1.MoveNext()

--- End of stack trace from previous location where exception was thrown

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Bot.Builder.Dialogs.Internals.Extensions.d__3`2.MoveNext()

--- End of stack trace from previous location where exception was thrown

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Bot.Builder.Dialogs.Conversation.d__5`1.MoveNext()

--- End of stack trace from previous location where exception was thrown

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Bot.Builder.Dialogs.Conversation.d__3`1.MoveNext()

--- End of stack trace from previous location where exception was thrown

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at notarobot.MessagesController.d__0.MoveNext() in C:\Projects\roboadvisor
otarobot
otarobot\Controllers\MessagesController.cs:line 28

--- End of stack trace from previous location where exception was thrown

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at notarobot.MessagesController.d__0.MoveNext() in C:\Projects\roboadvisor
otarobot
otarobot\Controllers\MessagesController.cs:line 35

--- End of stack trace from previous location where exception was thrown

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Threading.Tasks.TaskHelpersExtensions.d__3`1.MoveNext()

--- End of stack trace from previous location where exception was thrown

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()

--- End of stack trace from previous location where exception was thrown

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()

--- End of stack trace from previous location where exception was thrown

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()"

tomlm avatar May 20 '16 18:05 tomlm

@tomlm but why would it work on all of the other channels and only throw this on Facebook?

DavePilks avatar May 20 '16 19:05 DavePilks

@DavePilks my solution is delete de bot and create a new, is working fine now.

deivisonrpg avatar May 20 '16 20:05 deivisonrpg

I suspect you had bad data state which was causing your bot to throw an exception. Deleting bot and re-registering your bot is rather heavy hammer to use to fix it. Reseting your data with /deleteprofile command is better solution

tomlm avatar May 20 '16 20:05 tomlm

@tomlm I tried that, but re-register was only solution that solved the problem :(

deivisonrpg avatar May 20 '16 20:05 deivisonrpg

@DavePilks BotData is per user per channel, so if he had bad data for the user he was testing with, he would have continued to get a repeated error on that channel. Are you also having the same problem?

jameslew avatar May 21 '16 18:05 jameslew