Botframework-sdk: [State Service] All Channels, All Messages: "Sorry, my bot code is having an issue."

Created on 4 Dec 2017  路  35Comments  路  Source: microsoft/botframework-sdk

Bot Info

  • App ID: 05483456-e1be-45a5-95a1-d87fc89dbeba
  • SDK Platform: .Net
  • SDK Version: 3.12
  • Active Channels: Web Chat, Skype, Slack
  • Deployment Environment: Azure Bot Service, Azure App Service
  • Region: West US

Issue Description

Every message sent results in the correct message being sent back, but then a bot issue (error). I have checked the solitaire bot : https://bots.botframework.com/bot?id=Solitaire, and it is experiencing the same issue. I started on 3.9 and upgraded to 3.12 with no improvement.
image

Code Example

Any

Reproduction Steps

  1. Send any message.

Expected Behavior

The response, without an error, and the ability to accept a new response.

Actual Results

Response, then an error, and resets.

Most helpful comment

@JasonSowers - this is good to know. Maybe I just missed it in the docs or something, but I had no idea.

In any case, to the other neophytes in here, even I was able to implement this in about 10 minutes, and I didnt have that nice article linked directly above. Table storage seems to make the most sense and is easiest IMO.

You just add a few lines of code to global.cs.

All 35 comments

I am also experiencing this exact same issue. Bot worked perfectly fine before the weekend.
botissue

I am getting the same issue as well.

me too since yesterday

This error appears to now have moved on to the messages not being sent at all. The webchat also will either not load or not send. Skypebot also appears to be offline for the moment, possibly related or not.

@dkershner6 if you type /deleteprofile to your bot what happens when you try to have a conversation afterwards?

@sharontf @KIBASSA please provide your app IDs

we had a similar issue - moving the bot (session) state to a persistent db seemed to have solved the issue

I'm having similar strange issues in which the bot doesn't seem to update its state anymore. I'm still using the state service. Did something change in the past day?

@Kannaj Correct, the issue was resolved after moving to state to db.

@JasonSowers: In future, can this be handled better like informing via emails?

@sagarpomal @Kannaj I may be misunderstanding, but what do you mean by "moving the bot (session) state to a persistent db"?

This is my bot ID link https://dev.botframework.com/bots?id=emiko (only on messenger)
What does that mean 'moving to state to db'?

@JasonSowers it now works, even though I didnt change anything at all...

I did test the deleteprofile on the solitairebot though, it doesnt seemed to have worked, and that bot is still having issues.

I am also a bit in the dark between the difference of the state service and using a persistent DB...

I am still experiencing the issue of "Sorry, my bot code is having an issue". Location: South Central US

If you are having this issue please provide your app ID so we can investigate and track

@JasonSowers App ID: 62a3f1ae-f10a-43f4-ac70-d2c22b3f69a5

App ID:d10755e5-fd3d-4824-8492-3b18a8455af6

A known solution is to implement a custom state store rather than use the default state store details can be found here for c#, and here for node. The default state store is intended for prototyping only and is not intended for production bot. We highly recommend all bots Implement a state store that is not the default.

We are still actively investigating.

Same here, been happening for 24 hours and still on-going for Web Chat, Facebook Messenger, Skype and Direct Line channels. Any other examples of a state storage using SQL Server? I already have a database I can use.
AppID: 386a3c4e-a7df-4ff9-85ff-a0271820d254

There are also samples in this repo https://github.com/Microsoft/BotBuilder-Azure one of them is for AzureSQL. If you were planning to use an on-premise SQL server it would have to be publically exposed.

@ThisIsColinB : Please refer the comment above by JasonSowers.

I've found this: https://blog.botframework.com/2017/07/26/saving-state-sql-dotnet/ and the sample code here: https://github.com/Microsoft/BotFramework-Samples/tree/master/blog-samples/CSharp/AzureSql-StateClient/Microsoft.Bot.Sample.AzureSql

Obviously not going to put a SQL Server public on the web but would seem easy enough to put a simple Web API in front of it. Where exactly is the state service called from? Is it ever called from somewhere other than my own bot code?

Is there any insight as to why the default state store has suddenly stopped working though? I realize you are still investigating, but I am just confused how things went from working perfectly, to not at all with no code change.

@stuprice your bot code would be where it is called from

@ThisIsColinB I do not want to put out bad information so I'm going to wait until we know for sure about the root cause.

@JasonSowers thanks, just needed to clarify that. So in performance terms it will be better to host the state database close to my bot - in this case it will be just 'next door' :-)

yes, very much so @stuprice

To reiterate, There is a known solution to fix this issue that involves implementing a state store rather than using the default state service. The default state service is intended for use in prototyping only. Any production level bot should already be using an implementation of a state service rather than the default.

For more information

C#
Blog Post With Examples
BotBuilder-Azure Samples C#

Node
Blog Post With Examples
BotBuilder-Azure Samples Node

@JasonSowers - this is good to know. Maybe I just missed it in the docs or something, but I had no idea.

In any case, to the other neophytes in here, even I was able to implement this in about 10 minutes, and I didnt have that nice article linked directly above. Table storage seems to make the most sense and is easiest IMO.

You just add a few lines of code to global.cs.

@ThisIsColinB your bot appears to be working now, can you confirm?

@dkershner6 thanks for sharing 馃憤

Hi @JasonSowers,
This is affecting our bot as well; app id: fa6e93fc-6a8a-42b7-a4a6-e72c9508e46c

I understand that your recommendation is to incorporate our own state service. We are looking into it as I type this. Is there something you can do on your end to correct the issue for this bot while we work on switching to our custom state service?

Thank you!

@jeffhee I was able to go through what seems like the whole process of your bot and got to the dialog below. What is the behavior you are seeing causing concern? To answer your question we are currently investigating the cause so we do not have a solution other than the one I recommended thus far

image

Hi Jason,
Thanks. Prior to your response, the bot was consistently retriggering the firstRun intent, which we interpret as being caused by storing the current version number in the default state service.

It does work now.

Thank you

@jeffhee please let us know on this thread if it happens again

@JasonSowers the regular state service is working for me now. Thanks for you help and info. I also didn't realise the default state service wasn't for production use so I'm implementing it as we speak.

@JasonSowers Yes my bot seems to be working now. Thanks for the help and information!

@KIBASSA please open a new issue your bot does not seem to be functional still, but from what we can see it is unrelated to this issue. we see that you have app insights enabled please look there for more information and if possible put your code in a repo or post it in the new issue.

Closing this as all bots affected should be working now please open a new issue if your bot is not working

Was this page helpful?
0 / 5 - 0 ratings