Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MS bot with Ms teams channel gives 400 error #124

Open
rjgmail88 opened this issue Jun 14, 2018 · 26 comments
Open

MS bot with Ms teams channel gives 400 error #124

rjgmail88 opened this issue Jun 14, 2018 · 26 comments

Comments

@rjgmail88
Copy link

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)
``
@billbliss
Copy link
Contributor

@rjgmail88 what's the AppId of your bot?

@rjgmail88
Copy link
Author

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

@rjgmail88
Copy link
Author

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

@billbliss
Copy link
Contributor

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

@rjgmail88
Copy link
Author

Any updates?

@rjgmail88
Copy link
Author

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
Copy link
Author

Please update us on this.

@rjgmail88
Copy link
Author

@billbliss

@billbliss
Copy link
Contributor

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

@rjgmail88
Copy link
Author

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
Copy link
Author

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

@rjgmail88
Copy link
Author

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
Copy link
Author

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

@rjgmail88
Copy link
Author

Still seeing this issue.

@rjgmail88
Copy link
Author

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)

@andregouveia8
Copy link

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

@gnarsiMSFT
Copy link

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

@OptimusRhine
Copy link

OptimusRhine commented Aug 20, 2018

@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.

@mohyt
Copy link

mohyt commented Sep 7, 2018

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

@billbliss
Copy link
Contributor

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

@nguyendn
Copy link

nguyendn commented Feb 7, 2019

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:1290d5cafeb545a1ae683b8e6eec09fe@thread.skype","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:1290d5cafeb545a1ae683b8e6eec09fe@thread.skype"},"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) {});

@lecodespinner
Copy link

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.

@nguyendn
Copy link

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

@rjgmail88
Copy link
Author

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 ?

@lakshmanjamili
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants