microsoft / botbuilder-dotnet

Welcome to the Bot Framework SDK for .NET repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using .NET.
https://github.com/Microsoft/botframework
MIT License
869 stars 479 forks source link

Facebook channel getting flooded with "Failed to validate incoming Facebook message" #750

Closed Sire closed 5 years ago

Sire commented 6 years ago

Bot Builder v4.0.1 .NET Core 2.0

I've setup the echo bot and a Facebook channel, published to Azure and sending/receiving messages and everything else works fine.

However, I get flooded with these FB channel warnings around every 2 minutes: "Failed to validate incoming Facebook message. Make sure your FacebookAppSecret is entered correctly."

I've triple checked the facebook app id, secret, page id, page token.

I'm using a Facebook app in test mode if that matters. Any ideas?

Custom event log details:

Application version: Thu 07/12/2018 21:33:44.42 
UTC (factoryvm-az373) [Build 36484] [Repo Intercom] [Branch prod] [Commit c1c58d0f0027fbe311b8d18906c95f78d1cfbf2e] 
Bot ID: Bot
Channel ID: facebook
Client IP address: 0.0.0.0
Correlation ID: |/6wjT/qVSf8=.ddc61fad_
Country or region: Ireland
Device type: PC
Event count: 1,00
Event name: Facebook message failed
Event time: 2018-07-13 11:21:58
EventName: Facebook message failed
Message: Failed to validate incoming Facebook message. Make sure your FacebookAppSecret is entered correctly.
Operation ID: |/6wjT/qVSf8=.ddc61fad_
Operation name: POST /api/v1/bots/Bot
Operation parent ID: |/6wjT/qVSf8=.ddc61fad_
Role instance: RD0003FF74BC14
Role name: bc-facebook-weurope
SDK version: dotnet:2.6.4-28384
daveta commented 6 years ago

@vishwacsena please investigate.

vishwacsena commented 6 years ago

@Sire I cannot repro this. Can you clarify where you see these events logged to?

stevengum commented 6 years ago

Closing due to lack of activity. Please reactivate if you continue to see this or will additional information on where you were seeing these events logged to.

Sire commented 6 years ago

@vishwacsena Sorry was on vacation.

Under my Azure "Web App Bot", page "Channels", under the "Health" column for channel "Facebook Messenger".

After I successfully send and receive a message it says "Warnings (2)" in this column. Clicking to show details displays:

Facebook Messenger Recent issues Clear All Time Message 7/30/2018, 12:57:33 PM Failed to validate incoming Facebook message. Make sure your FacebookAppSecret is entered correctly. 7/30/2018, 12:57:24 PM Failed to validate incoming Facebook message. Make sure your FacebookAppSecret is entered correctly.

1110770MiguelSilva commented 6 years ago

Having same problem when using test app.

vovanb commented 6 years ago

same issue , nothing changed and got error now. No message delivered to application

Sire commented 6 years ago

@stevengum please reopen

stevengum commented 6 years ago

@1110770MiguelSilva, and @vovanb, please provide which template you're using if any and the botID and bot handle for your bot.

stevengum commented 6 years ago

@jwiley84, can you investigate? Thanks!

jwiley84 commented 6 years ago

Hi @Sire!

Couple of things: what Facebook Page Subscriptions are you using? For example:

subs

Also: When you say "In test mode", do you mean your app on the Facebook Developer Portal is set to 'Status: In Development'?

Sire commented 6 years ago

@jwiley84 Yes I use those exact page subscriptions (webhooks).

Yes, I use the test version of my app, and it's in development mode. I think I've tried the non-test version as well (that is in live mode), but I can double check.

jwiley84 commented 6 years ago

@Sire,

Just for clarification, you are successfully receiving responses from you bot, and this is only showing on the channels blade of your bot on Azure?

To be the bearer of bad news, I know that messaging_optins was not supported in the v3 SDK, so chances are very high that it isn't currently supported in the v4 SDK. Not that I think that it's the core of the issue, as a simple echobot wouldn't need optins, just that might be a possible impact.

Sire commented 6 years ago

@jwiley84 That is correct.

Ok, should I try to remove messaging_optins and see if the problem goes away?

jwiley84 commented 6 years ago

@Sire

If this is just an echo bot, then you shouldn't be calling 'messaging_optins' in the code at all, so that SHOULDN'T be the issue, but yes, go ahead and turn that one off, and let me know what happens.

jwiley84 commented 5 years ago

@Sire are you still having this issue?

Sire commented 5 years ago

@jwiley84 After removing messaging_optins I still receive warnings, but one less. 4 now, was 5 before (per initial message sent). They drop in one every ~20 seconds after the initial first message sent.

2015PM commented 5 years ago

I'm forced with the same issue. I'm using bot framework 3.16.xx and got the same Problem. I'm 100 percent sure that i took the right secret (According to the documentation (https://docs.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-facebook?view=azure-bot-service-3.0)) Error-Message:

01/11/2018, 1:01:42 PM Failed to validate incoming Facebook message. Make sure your FacebookAppSecret is entered correctly.
01/11/2018, 12:56:33 PM Failed to validate incoming Facebook message. Make sure your FacebookAppSecret is entered correctly.
01/11/2018, 12:55:18 PM Failed to validate incoming Facebook message. Make sure your FacebookAppSecret is entered correctly.
01/11/2018, 12:54:25 PM There was an error sending this message to your bot: HTTP status code InternalServerError
01/11/2018, 12:54:03 PM Failed to validate incoming Facebook message. Make sure your FacebookAppSecret is entered correctly.

Thanks for your support.

jwiley84 commented 5 years ago

@Sire: I know it's been a while, but digging around in Facebook dev show that they've been undergoing changes to their dev app review and publish process you might have caught the tail end of. Just to double check: are you still having this issue, and is it still impacting your bot's ability to function?

@2015PM: please open a separate issue on Botbuilder-v3 and I can work with you on that thread.

jwiley84 commented 5 years ago

Closing for lack of response.

LouisTinant commented 5 years ago

Hello, could you please reopen this flow? I have the same issue with the message : Failed to validate incoming Facebook message. Make sure your FacebookAppSecret is entered correctly.

My bot works in the test channel but not on Facebook or other channel

Sire commented 5 years ago

@jwiley84 I do not see these errors anymore since upgrading to Bot Builder v4.2.0 and .NET Core 2.1.

EugeneFoo commented 5 years ago

still receiving this message on bot framework 4.2 node js. I can confirmed my app secret is totally correct, and remove and add again FB channel still the same.

Screen Shot 2019-03-21 at 1 19 54 PM
anagor commented 4 years ago

Hello, Any news on it? I'm getting this error a lot on some bots, but not on others. Let me know what type of information I can provide for you to investigate it further.

Thank you,

EricDahlvang commented 4 years ago

Hi @anagor

This issue is closed, and closed issues are not monitored by the team. Please open a new issue or ask a question on stack overflow.

Also, something to check is the facebook page subscription fields. Are they the same on the bots with errors as the bots without errors?