microsoft / BotBuilder-V3

Microsoft Bot Builder V3 SDK for Microsoft Bot Framework
MIT License
51 stars 61 forks source link

Bot is failing to communicate on Facebook Channel ( Bad Request ) #132

Closed Alexander-0x80 closed 5 years ago

Alexander-0x80 commented 5 years ago

Version

"botbuilder": "^3.13.1",
"botbuilder-azure": "^3.0.4"

Describe the bug

Bot was working fine for a lot of time ( on Facebook Channel ), no code changes where made. From 15/04/2019 Bot stopped responding to Facebook messages with the following error:

Error: POST to 'https://facebook.botframework.com/v3/conversations/xxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxx/activities/vM8xdHOumCjl_b_wdJMclUXt8gbAMoHzCIklsYqfTeWLMmK49afoLlymD-y_42dRmhTgMkfL399qBQwD-iVGjQ' failed: [400] Bad Request
    at Request._callback (/home/bots/node_modules/botbuilder/lib/bots/ChatConnector.js:675:46)
    at Request.self.callback (/home/bots/node_modules/request/request.js:185:22)
    at Request.emit (events.js:197:13)
    at Request.EventEmitter.emit (domain.js:446:20)
    at Request.<anonymous> (/home/bots/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:197:13)
    at Request.EventEmitter.emit (domain.js:446:20)
    at IncomingMessage.<anonymous> (/home/bots/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:285:13)
    at IncomingMessage.emit (events.js:202:15)
    at IncomingMessage.EventEmitter.emit (domain.js:446:20)
    at endReadableNT (_stream_readable.js:1129:12)
    at processTicksAndRejections (internal/process/next_tick.js:76:17)

Web Chat on Azure Portal works as expected. Looking at 'Connected Channels' View on Azure Portal shows no issues at all !

image

Incoming messages are received by the bot. Issue arises when bot tries to reply to a message. Have no ideas how to debug this further.

[bug] [javascript]

EricDahlvang commented 5 years ago

Hi @Alexander-0x80

Do you have Application Insights configured for the bot? You should be able to find more information about this error there.

Have you tried refreshing your facebook page token?

It looks like this is on the Facebook end:

(#2022) Your account has been disabled. If you have any questions or concerns, you can visit our FAQ page.

Alexander-0x80 commented 5 years ago

Hi @EricDahlvang

Yes, i have Application Insights configured, but i don't seem to find any error related information there. Also i have tried multiple times to refresh my token.

This Error message you have attached, how did you find it ? I am able to login/logout from Facebook without any issue, so this is really confusing.

EricDahlvang commented 5 years ago

This error should be propagated back to your bot if you are logging exceptions. It shows in our logs.

Alexander-0x80 commented 5 years ago

The exceptions are being logged in app insights, this is how it looks like:

image

We do not see any error description there. Only status codes as i mentioned above. I would really appreciate if you could guide me how to find any description.

Also you mention that "in our logs" you see the error message. Are we talking about a same bot ? because we are running multiple bots on this account.

In addition i would like to make another point if i may. Lets say we discard the reason of the error for a moment, it does not matter. What matters is that there is an error happening on the Facebook Channel !

How come that the Channels page of the bot shows "Running" status ?

image

In past we had cases where one of our Facebook users was blocked, we could clearly see this in the error log of the channel when clicked on "Issues (11)"

Like this:

image

Is this an expected result ?

EricDahlvang commented 5 years ago

No, that looks like a bug. The Health column should be showing exceptions, and your application insights should show the Facebook API error as well. I will investigate further, and get back to you.

EricDahlvang commented 5 years ago

Hi @Alexander-0x80

I apologize for the late response. An engineer is investigating why this error is not showing in the bot's health column. I'll let you know when I get more information.

EricDahlvang commented 5 years ago

@Alexander-0x80 please share the Bot Handle for this bot. If you prefer, you can email it to me on the address on my profile.

EricDahlvang commented 5 years ago

@Alexander-0x80

We are logging invalid token errors:

image

If you see a similar problem, where we are not logging Facebook Messenger connector errors in the health column, please open a new issue.