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

There was an error sending this message to your bot: HTTP status code InternalServerError

Open varunsethnsit opened this issue 9 years ago • 5 comments

We have built a bot with Bot framework (V > 3.0). We have been testing/working with our bot on the emulator in local machine and the results are as expected, bot works properly. However, when we start using the deployed (on Azure) version of our bot and work with FB Messenger or Skype, we get the error mentioned in the https://dev.botframework.com/ Channels Issues section. 'There was an error sending this message to your bot: HTTP status code InternalServerError'.

  • To add, while deploying our bot to Skype/FB, we have ensured that the AppID and AppPassword have been correctly updated and have tested the connection with test utility available on dev.botframework portal.

  • We debugged to understand the issue better and it turns out that the bot is throwing on the very first SetPrivateConversationDataAsync call. We added exception handling to the state management calls (storing the bot data), and the exception states 'Precondition failed'.

  • The documentation states Bot data storage might run into concurrency issues when multiple messages are trying to store the state. Though ours is a single bot service servicing single customer message, we tried the suggested solution var builder = new ContainerBuilder(); builder .Register(c => new CachingBotDataStore(c.Resolve(), CachingBotDataStoreConsistencyPolicy.LastWriteWins)) .As<IBotDataStore>() .AsSelf() .InstancePerLifetimeScope(); builder.Update(Conversation.Container);

,however, issue fails to go away.

  • We even have upgraded the bot framework to build 3.2 (and the associated dependencies to a compatible version) but still no help.

Can you please help address the issue, since we have been bogged down on this from a long time and its blocking our bot service to be integrated with FB/Skype channels.

varunsethnsit avatar Dec 29 '16 06:12 varunsethnsit

Are you using both the REST client IStateClient and builder-level IBotData together? If you're calling SetPrivateConversationDataAsync, that's from IStateClient.

willportnoy avatar Dec 29 '16 18:12 willportnoy

This is the call we are making stateClient.BotState.SetPrivateConversationDataAsync(activity.ChannelId, activity.Conversation.Id, activity.From.Id, botData); to store the modified properties of the bot.

varunsethnsit avatar Dec 31 '16 15:12 varunsethnsit

Im having the same issue. I used to Azure template for Q&A with qnamaker.ai

micml75 avatar Jan 02 '17 14:01 micml75

@varunsethnsit @micml75 if you use the REST-level state client and the builder-level bot data bags at the same time, you're going to see etag consistency issues. I'd recommend reading this faqs

https://docs.botframework.com/en-us/technical-faq/#what-is-an-etag--how-does-it-relate-to-bot-data-bag-storage

and if you want to disable etag consistency checking, you can use this code: https://github.com/Microsoft/BotBuilder/issues/960#issuecomment-239435998

willportnoy avatar Jan 03 '17 02:01 willportnoy

I'm going to close this issue for now, but feel free to open a new issue for further discussion.

willportnoy avatar Jan 19 '17 22:01 willportnoy