BotBuilder-MicrosoftTeams icon indicating copy to clipboard operation
BotBuilder-MicrosoftTeams copied to clipboard

MS bot with Ms teams channel gives 400 error

Open rjgmail88 opened this issue 6 years ago • 26 comments

I have V3 BOT with Microsoft teams channel. I see following sporadic issue where it seems like teams is failing send response back to bot via serviceURL

Error: POST to 'https://smba.trafficmanager.net/amer-client-ss.msg/v3/conversations/a%3A1qNZgTUu4ASGZkGKPYDtZque7ucUYmAuWHi7pVx2qfw7gtuHtEUybWEJnQDeZl31zAcglGMyoxKUik-VOpLKqGXop4UFTiQ70NZzkj49LHhNSeVlYFnJTCAjVVFtoViDt/activities/1529002753254' failed: [400] Bad Request
    at Request._callback (D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\ChatConnector.js:559:46)
    at Request.self.callback (D:\home\site\wwwroot\node_modules\request\request.js:186:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (D:\home\site\wwwroot\node_modules\request\request.js:1163:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (D:\home\site\wwwroot\node_modules\request\request.js:1085:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1055:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)
``

rjgmail88 avatar Jun 14 '18 19:06 rjgmail88

@rjgmail88 what's the AppId of your bot?

billbliss avatar Jun 14 '18 20:06 billbliss

There are 2 BOTS. Above error is for BOT ID#984ede7e-bc35-4767-a19b-60a2d6c5e4be Another bot is bc6873dc-1736-40be-98cc-b55df64647b4

rjgmail88 avatar Jun 15 '18 03:06 rjgmail88

Has anything change ? I am seeing 502 and bot is completely down in production. Please advice asap if you can. We have a outage.

Error: POST to 'https://smba.trafficmanager.net/amer-client-ss.msg/v3/conversations/a%3A1qNZgTUu4ASGZkGKPYDtZque7ucUYmAuWHi7pVx2qfw7gtuHtEUybWEJnQDeZl31zAcglGMyoxKUik-VOpLKqGXop4UFTiQ70NZzkj49LHhNSeVlYFnJTCAjVVFtoViDt/activities/1529075330199' failed: [**502**] Bad Gateway

rjgmail88 avatar Jun 15 '18 15:06 rjgmail88

Checking on it now. We are seeing increased 5xx errors at this time.

billbliss avatar Jun 15 '18 16:06 billbliss

Any updates?

rjgmail88 avatar Jun 15 '18 20:06 rjgmail88

Our production bot is down over 8 hours. Please let me know if this is going to take long to fix so I can have some communication plan for the business.

rjgmail88 avatar Jun 15 '18 20:06 rjgmail88

Please update us on this.

rjgmail88 avatar Jun 18 '18 04:06 rjgmail88

@billbliss

rjgmail88 avatar Jun 19 '18 03:06 rjgmail88

I have been communicating with Andrea Martini on this and he said this particular issue seems to be resolved.

billbliss avatar Jun 20 '18 03:06 billbliss

Error: POST to 'https://smba.trafficmanager.net/amer-client-ss.msg/v3/conversations/a%3A1hBGKzVwG1NG4tAyQeS7mKg4mNeYErz4rl2vJjNxIGQZJMy1eAiBBuKlPn-1w7-E2OwwB4Bm1imay1xLgRhMOrLRci2rzO1HZu6VUdNRNd0yVuGhgQfJPi02OyL71hJgr/activities/1529526049208' failed: [502] Bad Gateway

I am seeing this again today. Is there any permanent fix for this ? How should we handle this for productions bots ?

rjgmail88 avatar Jun 20 '18 20:06 rjgmail88

I am seeing this again today. Is there any permanent fix for this ? How should we handle this for productions bots ?

rjgmail88 avatar Jul 03 '18 16:07 rjgmail88

Here is the conversation Id "conversationId" : "a:1qNZgTUu4ASGZkGKPYDtZque7ucUYmAuWHi7pVx2qfw7gtuHtEUybWEJnQDeZl31zAcglGMyoxKUik-VOpLKqGXop4UFTiQ70NZzkj49LHhNSeVlYFnJTCAjVVFtoViDt"

and error

Error: POST to 'https://smba.trafficmanager.net/amer/v3/conversations/a%3A1qNZgTUu4ASGZkGKPYDtZque7ucUYmAuWHi7pVx2qfw7gtuHtEUybWEJnQDeZl31zAcglGMyoxKUik-VOpLKqGXop4UFTiQ70NZzkj49LHhNSeVlYFnJTCAjVVFtoViDt/activities/1530634672666' failed: [502] Bad Gateway

    at AppInsightsAsyncCorrelatedErrorWrapper.ZoneAwareError (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:811:33)

    at new AppInsightsAsyncCorrelatedErrorWrapper (D:\home\site\wwwroot\node_modules\applicationinsights\out\AutoCollection\CorrelationContextManager.js:193:18)

    at Request._callback (D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\ChatConnector.js:647:46)

    at Request.self.callback (D:\home\site\wwwroot\node_modules\request\request.js:185:22)

    at ZoneDelegate.invokeTask (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:275:35)

    at Zone.runTask (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:151:47)

    at Request.ZoneTask.invoke (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:345:33)

    at emitTwo (events.js:126:13)

    at Request.emit (events.js:214:7)

    at Request.<anonymous> (D:\home\site\wwwroot\node_modules\request\request.js:1157:10)

    at ZoneDelegate.invokeTask (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:275:35)

    at Zone.runTask (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:151:47)

    at Request.ZoneTask.invoke (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:345:33)

    at emitOne (events.js:116:13)

    at Request.emit (events.js:211:7)

    at IncomingMessage.<anonymous> (D:\home\site\wwwroot\node_modules\request\request.js:1079:12)

    at Object.onceWrapper (events.js:313:30)

    at ZoneDelegate.invokeTask (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:275:35)

    at Zone.runTask (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:151:47)

    at IncomingMessage.ZoneTask.invoke (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:345:33)

    at emitNone (events.js:111:20)

rjgmail88 avatar Jul 03 '18 16:07 rjgmail88

@billbliss , can you let us know if you are not managing this ? Can you route us to correct team ?

rjgmail88 avatar Jul 06 '18 15:07 rjgmail88

Error: POST to 'https://smba.trafficmanager.net/amer/v3/conversations/a%3A1iW4wvOYbpsOa0fRviAt7tkak6uCn2ntSALF3V_EIkKLFpG92XFACmCu0r0d2vhp6l_UGX6vDIR86y74Oolw--daWsVyV5dzDEWfD8yeamr58T1zwqWCBiYSGHvewNC90/activities/1531511292475' failed: [400] Bad Request

rjgmail88 avatar Jul 13 '18 20:07 rjgmail88

Still seeing this issue.

rjgmail88 avatar Jul 13 '18 20:07 rjgmail88

I am getting 502 today.

Error: POST to 'https://smba.trafficmanager.net/amer/v3/conversations/a%3A1iW4wvOYbpsOa0fRviAt7tkak6uCn2ntSALF3V_EIkKLFpG92XFACmCu0r0d2vhp6l_UGX6vDIR86y74Oolw--daWsVyV5dzDEWfD8yeamr58T1zwqWCBiYSGHvewNC90/activities/1531615376540' failed: [502] Bad Gateway at AppInsightsAsyncCorrelatedErrorWrapper.ZoneAwareError (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:811:33) at new AppInsightsAsyncCorrelatedErrorWrapper (D:\home\site\wwwroot\node_modules\applicationinsights\out\AutoCollection\CorrelationContextManager.js:193:18) at Request._callback (D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\ChatConnector.js:647:46) at Request.self.callback (D:\home\site\wwwroot\node_modules\request\request.js:185:22) at ZoneDelegate.invokeTask (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:275:35) at Zone.runTask (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:151:47) at Request.ZoneTask.invoke (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:345:33) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request. (D:\home\site\wwwroot\node_modules\request\request.js:1157:10) at ZoneDelegate.invokeTask (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:275:35) at Zone.runTask (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:151:47) at Request.ZoneTask.invoke (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:345:33) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at IncomingMessage. (D:\home\site\wwwroot\node_modules\request\request.js:1079:12) at Object.onceWrapper (events.js:313:30) at ZoneDelegate.invokeTask (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:275:35) at Zone.runTask (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:151:47) at IncomingMessage.ZoneTask.invoke (D:\home\site\wwwroot\node_modules\zone.js\dist\zone-node.js:345:33) at emitNone (events.js:111:20)

rjgmail88 avatar Jul 15 '18 00:07 rjgmail88

I have the same issue.. On my webchat channel works fine, but on microsoft teams channel im getting this error 400... 🤒

andregouveia8 avatar Aug 14 '18 10:08 andregouveia8

@andregouveia8 Can you please let me know the timestamp when you saw the issue and bot ID to check on this?

gnarsiMSFT avatar Aug 14 '18 17:08 gnarsiMSFT

~~@gnarsiMSFT I'm also seeing this issue as of about a week and a half ago.~~

Nevermind, I see that this is thread is specifically around MSTeams. Please ignore.

OptimusRhine avatar Aug 20 '18 17:08 OptimusRhine

I am getting the same issue, I am using botbuilder-teams: 0.2.1.

mohyt avatar Sep 07 '18 03:09 mohyt

@mohyt what's your bot ID? We'll look for it in the logs.

billbliss avatar Sep 07 '18 18:09 billbliss

It works before but recently we have a lot of 400 errors

Error: POST to 'https://smba.trafficmanager.net/apac/v3/conversations' failed: [400] Bad Request

Steps:

  1. Our client install our app
conversation update {"membersAdded":[{"id":"28:f56a1d76-2630-4200-bedc-fdff8a7672a6"}],"type":"conversationUpdate","timestamp":"2019-02-07T21:45:59.192Z","sourceEvent":{"team":{"id":"19:[email protected]","name":"TINYpulse Feed","aadGroupId":"362c5f09-f9f7-49bc-8ad5-895d3a8761a4"},"eventType":"teamMemberAdded","tenant":{"id":"1c3db24c-912d-4296-84ba-bafb8be4125d"}},"text":"","attachments":[],"entities":[],"address":{"id":"f:60079a89-a289-3435-178f-1f2ed003c107","channelId":"msteams","user":{"id":"29:1CLzSsI--OmPNzfe-l-n2n3HsJoyCOWqkADFyH37FOYf09YTngl74QwUbdxs--XoUbjW4xxPs__jZl4C6_Q7Amg","aadObjectId":"17cd9c0d-234a-4846-9c28-fcb385e50a8e"},"conversation":{"isGroup":true,"conversationType":"channel","id":"19:[email protected]"},"bot":{"id":"28:f56a1d76-2630-4200-bedc-fdff8a7672a6","name":"tinypulse"},"serviceUrl":"https://smba.trafficmanager.net/apac/"},"source":"msteams","agent":"botbuilder","user":{"id":"29:1CLzSsI--OmPNzfe-l-n2n3HsJoyCOWqkADFyH37FOYf09YTngl74QwUbdxs--XoUbjW4xxPs__jZl4C6_Q7Amg","aadObjectId":"17cd9c0d-234a-4846-9c28-fcb385e50a8e"}}
  1. And then when we send a welcome message to { id: '28:f56a1d76-2630-4200-bedc-fdff8a7672a6' }
  2. it raises 400 error

Our App ID is f56a1d76-2630-4200-bedc-fdff8a7672a6 The code is:

let teams = require("botbuilder-teams");
let builder = require("botbuilder");
let teams = require("botbuilder-teams");
let connector = new teams.TeamsChatConnector({
    appId: process.env.MicrosoftAppId,
    appPassword: process.env.MicrosoftAppPassword
});
let RedisStorage = require('botbuilder-redis-storage').RedisStorage;
let storage = new RedisStorage(redis);
let bot = new builder.UniversalBot(connector, function (session) {
    session.endDialog();
}).set('storage', storage);

/////

let msg = new builder.Message().address(buildAddress(member,tenantId, serviceUrl)).text(language.welcome);
bot.send(msg,function (e, r) {});

nguyendn avatar Feb 07 '19 22:02 nguyendn

Hey @nguyendn!

It appears that your bot is trying to send a message to itself? Is the id below a typo or the intended behavior?

And then when we send a welcome message to { id:**'28:f56a1d76-2630-4200-bedc-fdff8a7672a6'** }

Would you be able to provide more details on your end-to-end scenario? Also, could you capturing and provide the activity payload that your bot it sending? We can help you take a look from our end.

lecodespinner avatar Feb 08 '19 02:02 lecodespinner

@lecodespinner sorry for the late reply. It seems we made a mistake. Thank you for your response.

nguyendn avatar Feb 13 '19 20:02 nguyendn

I have started seeing these errors again massively. We have been seeing since this issue is logged but now they are frequent. Any update on this ?

rjgmail88 avatar Mar 06 '19 20:03 rjgmail88

Error in Bot service with message ******* POST to 'https://smba.trafficmanager.net/amer/v3/conversations/a%3A1taZNBMcuPHBqvkmOy9FgPv4Q1vO_3SuKdONKI90861H421bCoVhHGNBegQiH4mufNoljJ5FNWyIArZSCygghZE-ZPjnF5ElIqrUIsBAZDClAi4_nYyYKwlp5wUdAR7_9/activities/1567951571075' failed: [400] Bad Request******* stackTrace ******* Error: POST to 'https://smba.trafficmanager.net/amer/v3/conversations/a%3A1taZNBMcuPHBqvkmOy9FgPv4Q1vO_3SuKdONKI90861H421bCoVhHGNBegQiH4mufNoljJ5FNWyIArZSCygghZE-ZPjnF5ElIqrUIsBAZDClAi4_nYyYKwlp5wUdAR7_9/activities/1567951571075' failed: [400] Bad Request

We started to see this message starting friday, it was working fine till friday morning. please help, we are seeing this issue in all our dev and prod bots.

lakshmanjamili avatar Sep 08 '19 14:09 lakshmanjamili