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

[MS Teams] There was an error completing this request due to an internal channel failure.

Open dkushner opened this issue 9 years ago • 25 comments

I'm unsure if this is the appropriate place to post this question. If the Stack Overflow tag would be more appropriate (since this is not a specific issue with the library itself), just let me know and I'll remove it.

I'm encountering some intermittent issues sending messages to my bot via the Teams channel. The BotFramework dashboard shows the error mentioned in the title with no additional information. Strangely, if I change some of the bot's settings and save, the bot works for some time and then subsequent messages generate this error.

The bot itself is deployed in AWS and when these errors occur, my logs show that the message is never even forwarded to the server at all. The server itself is not generating any sort of error and my ELB logs never show any requests to the bot endpoint at all.

dkushner avatar May 15 '17 22:05 dkushner

@dkushner Thank you for reporting this issue. Are you using .NET or Node SDK for BotBuilder?

nwhitmont avatar May 15 '17 22:05 nwhitmont

@nwhitmont, the Node SDK. Just curious, why might that be relevant if the bot messages forwarded from Teams never reach my server?

dkushner avatar May 15 '17 23:05 dkushner

@dkushner can you share your bot id? Also when was the last time that you experienced these intermittent failures?

msft-shahins avatar May 16 '17 00:05 msft-shahins

I am using .NET and I am also getting the same warnings "5/16/2017, 11:28:53 AM There was an error completing this request due to an internal channel failure"

fkatada avatar May 16 '17 03:05 fkatada

@dkushner Can you post your bot ID and the time that you saw this error? Thx

nwhitmont avatar May 16 '17 17:05 nwhitmont

@fkatada We just released a patch for this in BotBuilder nuget v3.8.1 - let me know if this fixes your issue.

nwhitmont avatar May 16 '17 17:05 nwhitmont

@nwhitmont, sure, sorry about the delay.

c0e43964-f989-4893-b6a2-7836815526ee

dkushner avatar May 16 '17 18:05 dkushner

@nwhitmont: And for the record, we are seeing this errors continuously. The bot will be perfectly functional for a whole conversation or so and then suddenly stop responding at all right in the middle. Server never receives a single message.

Sometimes the server will receive the messages several minutes later. Sometimes they just never show up.

dkushner avatar May 16 '17 21:05 dkushner

@dkushner thanks for the update. I've passed this along to MS Teams rep to investigate.

nwhitmont avatar May 16 '17 23:05 nwhitmont

@nwhitmont i updated BotBuilder v3.8.1 and i still get the same errors

fkatada avatar May 17 '17 07:05 fkatada

Just wanted to drop a quick update @dkushner. We're still actively investigating this issue. I'll report back when we know more.

SheriEllisMSFT avatar May 18 '17 22:05 SheriEllisMSFT

@SheriEllisMSFT, thanks very much. Any indication as of now what might be causing this issue?

dkushner avatar May 22 '17 18:05 dkushner

@dkushner Hi Dave, I have asked the internal teams to investigate, and we're still investigating. It's so strange that the problem happens intermittently, and per your comments, it seems like the connection is freshened from updating the settings, and then becomes stale again. Our engineering team provided the attached graph of transactions we're receiving, thinking maybe there are patterns related to time of day. Is this helpful? I'm also discussing with another escalation team. Just didn't want you to think we abandoned you! Have you contact Office Support? traffic

SheriEllisMSFT avatar May 30 '17 18:05 SheriEllisMSFT

Is there any update on this? Facing same issue for Skype. App Id - e70cad6d-f939-4d41-91c4-aca50202b6f5

prasanna-bigreco avatar Jun 02 '17 08:06 prasanna-bigreco

@SheriEllisMSFT, I have not contacted Office Support, is this something that they can help with? It seems unrelated to our teams installation and more on the side of whatever intermediate server is processing the teams message events. Appreciate your work so far, hope to get some closure on this soon.

dkushner avatar Jun 08 '17 00:06 dkushner

@dkushner and @prasanna-bigreco Hi Dave and Prasanna, I had posted a couple questions to you both previously, which seem to have disappeared. Here they are again:

  • Can you tell us if you've tried adding your bot to other channels, to test if it's channel-specific?
  • And do you have telemetry on your side to look at traffic?

I'm in the group that supports the developer community, if this was a question related to code in the bot or connecting a bot to Teams, etc. So if you can try other channels, other teams, we could rule out configuration.

But this might be a production issue that Office Support should be triaging with their tools, tracing traffic patterns, etc. So I do think it would be good to engage them. Since there are multiple systems involved, it's hard to know where the issue lies. Please let us know and keep us posted!

SheriEllisMSFT avatar Jun 08 '17 17:06 SheriEllisMSFT

@SheriEllisMSFT, this issue does occur with other bots and other teams. I have not yet tried to connect the bot to other channels, we use some fairly teams-specific functionality in our message handling but I can try to adapt it.

As far as telemetry, the furthest we can see is when the request hits our Amazon ELB and when we see this, we see our response immediately afterwards. The problem is that this occurs well after the original message was sent, if at all.

It seems that other users have reported having this same issue elsewhere, perhaps we can find some common factor? @prasanna-bigreco, what's your setup like?

dkushner avatar Jun 08 '17 18:06 dkushner

I am also having an issue with Teams:

There was an error completing this request due to an internal channel failure.

I have a development and production version of my bot and both are experiencing the same issue. Both also work without an issue on slack and using the web chat from the dashboard.

Both however are completely failing on Skype although I think this is likely to be a completely different issue. On Skype I don't get any errors in the dashboard but get the generic bot error returned to the conversation:

Sorry, my bot code is having an issue.

Skype for business also seems to have the same issue as Skype. There was also an issue with the incorrect presence being displayed on Skype for business.

A little more on the Skype aspect, my bot allows the user to connect to their intranet and so the first thing it does if there is nothing in state is ask for your intranet Url. Once it has that it will render login card. The bot is currently just looping on asking for a Url and fails when it should render a login card.

I have an admin dialog route which allows me to read and clear my state which still works on Skype despite the above.

I've had this working without an issue across all channels bar Skype for Business, which never seemed to work (always the above Skype issue). I have recently upgraded to 3.8.1, use the .Net library and implemented the new ConversationReference to resume conversations after authentication. If I can provide any more details let me know. I don't currently have telemetry on but I can set it up and see if it gives me a little more to work off.

UPDATE:

I've switched diagnostic logging on to verbose in Azure for my production bot, and it is now working in Teams (probably coincidental), but highlighting some inconsistent behaviour with the channel.

Very interestingly though, my development bot which has logging switched off isn't currently working in teams.

The Skype issue is now resolved, urls seem to have changed to be sent to the bot as an anchor rather than the url or like some channels like slack do wrapped in "< url >".

mcinnes01 avatar Jun 12 '17 08:06 mcinnes01

@prasanna-bigreco Hi Prasanna. Can you please share the botId and the timestamp you faced this issue? Also, would it be possible to describe your setup(Azure/AWS ? ) so that we can check if there is a common pattern to this issue?

gnarsiMSFT avatar Jun 27 '17 19:06 gnarsiMSFT

@dkushner Hi Dave, I'm looking for some other patterns to narrow down on this. 1.When you say " if I change some of the bot's settings and save, the bot works for some time and then subsequent messages generate this error.", do you mean you changed the bot framework settings for your bot? Also, what settings changes lead to success in getting the messages sent. 2. I wanted to correlate a few timeouts that with whether you see them in the logs. Please let me know if you receive any of the below calls. Given below timestamp T, you can search from T- 10 to T to see if you received at your ELB layer or your instances. Also mentioned are the threadIds. 05-13-2017 16:41:29 19:[email protected];messageid=1494718877276 05-15-2017 09:34:59 19:[email protected];messageid=1494866087370 05-15-2017 12:57:49 19:[email protected];messageid=1494878257272 05-15-2017 14:41:11 19:[email protected];messageid=1494884460163 05-15-2017 14:41:32 19:[email protected];messageid=1494884480618 3. To help us isolate the problem, Can you please try performing a few repeated periodic POSTs from an external network to your bot POST ELB endpoint and confirm on the service reliability/latency of responses and let us know?

Thanks in advance, Narsi.

gnarsiMSFT avatar Jun 27 '17 23:06 gnarsiMSFT