Problem with Facebook channel.
Worked fine since yesterday.
project.json:
{
"frameworks": {
"net46":{
"dependencies": {
"Autofac": "4.7.0",
"Newtonsoft.Json": "11.0.2",
"microsoft.adaptivecards": "0.5.1",
"Microsoft.Azure.WebJobs": "2.2.0",
"microsoft.bot.builder.azure": "3.2.5",
"Microsoft.Cognitive.LUIS": "2.0.2",
"WindowsAzure.Storage": "9.3.0",
"System.Net.Http": "4.0.0"
}
}
}
}
Active Channels: Facebook
Microsoft.Rest.HttpOperationException: The bot referenced by the 'from' field is unrecognized
at Microsoft.Bot.Connector.ErrorHandling.
--- 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.Connector.ConversationsExtensions.
--- 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.ValidateEnd(Task task)
at Submission#0.
var connector = new ConnectorClient(new Uri(activity.ServiceUrl));
Activity typingReply = activity.CreateReply();
typingReply.Type = ActivityTypes.Typing;
//exception will be thrown here
await connector.Conversations.ReplyToActivityAsync(typingReply);
WebChat is working fine
Facebook connection works fine and the bot code will be triggered.
part of the input message:
....
"serviceUrl":"https://facebook.botframework.com","channelId":"facebook","from":{"id":"14148xxxxxxxxxx","name":"Martin xxxxx"},"conversation":
.....
Strange thing is that all works fine for the last months.
But today I got this issue.
Did facebook changed anything?
Any solutions or ideas?
quick update:
I updated microsoft.bot.builder.azure from "3.2.5" to "3.15.2.2".
Still WebChat and DirectLine are working fine.
From Facebook I got the error message:
Microsoft.Bot.Connector.ErrorResponseException: Operation returned an invalid status code 'BadRequest'
at Microsoft.Bot.Connector.Conversations.
--- 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.Connector.ConversationsExtensions.
--- 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 Submission#0.
My fault:
Somehow my page access token was wrong. The error message was jsut confusing. After going into the step-by-step doc i was able to fix it.
Same has just happened to my bot in Telegram, and your answer was helpful.
I went to @BotFather in Telegram and invoked the /revoke command to change the token to access HTTP API.
Then I went to my Functions bot in the Azure Portal, and on Channels blade clicked on "Edit" on my Telegram bot. I pasted the new Access token, saved, and it works again!
Looks like the token somehow expired. I created my bot 355 days ago (Dec 14, 2017), and haven't changed the token since then.
Most helpful comment
Same has just happened to my bot in Telegram, and your answer was helpful.
I went to
@BotFatherin Telegram and invoked the/revokecommand to change the token to access HTTP API.Then I went to my Functions bot in the Azure Portal, and on Channels blade clicked on "Edit" on my Telegram bot. I pasted the new Access token, saved, and it works again!
Looks like the token somehow expired. I created my bot 355 days ago (Dec 14, 2017), and haven't changed the token since then.