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

There was an error sending this message to your bot. SKype bot & C#

Open ashay-88 opened this issue 10 years ago • 7 comments

My microsoft bot works absolutely fine with emulator. It has one reference to Weather api and couple of our API. Bot has Skype channel. When on skype, If I ask him weather thing, natural language processing works fine and I get reply. But when I ask bot something related to our api, it appears that luis doesnt return any entity. Because I have a condition which checks if rootObj.entities.count() == 0,then error message. I am getting this condition message. However, I have trained luis, updated that application and working find on emulator. On checking dev.botframework.com, I saw issues number, all had same description "There was an error sending this message to your bot." Anyway to debug? Please help...

ashay-88 avatar Aug 30 '16 11:08 ashay-88

Are you pointing to the same LUIS model on the emulator and when deployed in the cloud?

willportnoy avatar Aug 30 '16 18:08 willportnoy

Hi Will, Thanks for the reply.Definitely yes, I am pointing to same LUIS model. It works perfectly in Emulator. I get proper Intent and entities back from LUIS. But no luck when I work on Skype. On dev.botframework.com "my bots" section, I see issue , and the message again says "There was an error sending this message to your bot. "

UPDATE: There was a small mistake, I have two luis classes. the second class was also having intent and entity of type first class's intent and entity. Corrected. Now, from emulator when using ngrok if I talk to my bot deployed on azure, I get reply for weather API. But not for ours. dev.botframework.com doesnt show any issues but emulator shows 500 Internal server error msg. I have checked our APIs are accessible from outside our network.

Please help. Kind Regards, Ashay

ashay-88 avatar Aug 31 '16 04:08 ashay-88

You can remote debug your service in azure to see what causes the exception. Also you can run your bot locally and register an ngrok endpoint pointing to the local instance of your bot with the developer portal and debug your bot locally using the live traffic from Skype.

msft-shahins avatar Aug 31 '16 23:08 msft-shahins

Hi, I connected my emulator to deployed bot using ngrok.. yesterday issues were not shown on dev.botframework.com but the issue counter shows issues logged in midnight with same description..

On my emulator I am getting following exception which is getting fired while calling my APIs..

exception System.Net.WebException: The operation has timed out at System.Net.HttpWebRequest.GetResponse() at Bot_Application1.yahoo.d__4.MoveNext()

When I modified the way of calling "get" response from var jsonResponse = (HttpWebResponse)request.GetResponse(); to client.BaseAddress = new Uri(strApi); // strApi has my api in string. client is HttpClient. client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); HttpResponseMessage response = await client.GetAsync($"myapi/{from}/{to}");

I got following exception System.Threading.Tasks.TaskCanceledException: A task was canceled. at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Bot_Application1.yahoo.d__4.MoveNext()

Its not hitting api, where as api works in browser from any outside network. i tried to check if(successCode) {}else { some string return} it doesnt even go here.

I tried to increase timeout property of request, still no luck..

Thanks, Ashay

ashay-88 avatar Sep 01 '16 07:09 ashay-88

So your API's http request is timing out?

willportnoy avatar Sep 01 '16 17:09 willportnoy

Yes, my APIs are getting timed out when they are called from BOT. but when I call them via browser , they work fine.

ashay-88 avatar Sep 02 '16 04:09 ashay-88

Sorry, I don't have any insight why your API is timing out when called from code rather than a browser. Sometimes the proxy configuration is different between the two. I don't think this is an issue with the bot framework, so i'm going to close this issue, but feel free to open a new issue for bot framework related questions.

willportnoy avatar Sep 02 '16 15:09 willportnoy