microsoft / BotBuilder-Samples

Welcome to the Bot Framework samples repository. Here you will find task-focused samples in C#, JavaScript/TypeScript, and Python to help you get started with the Bot Framework SDK!
https://github.com/Microsoft/botframework
MIT License
4.34k stars 4.87k forks source link

Messaging extension search bot example getting UnhandledPromiseRejectionWarning: Error: BotFrameworkAdapter.processActivity(): 501 ERROR #2641

Closed DMarcusYoung closed 4 years ago

DMarcusYoung commented 4 years ago

Versions

What package version of the SDK are you using. 4.9.3 What nodejs version are you using v12 What os are you using Windows 10

Describe the bug

Give a clear and concise description of what the bug is.

Error from processActivity causing 501 Error when trying to run the sample messaging extension search command.

To Reproduce

Steps to reproduce the behavior:

  1. Use this sample: https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/javascript_nodejs/50.teams-messaging-extensions-search
  2. Click the messaging extension on Teams to run the search command
  3. MST says Unable to reach app. Please try again. and 501 Error on Server (node:2205412) UnhandledPromiseRejectionWarning: Error: BotFrameworkAdapter.processActivity(): 501 ERROR at BotFrameworkAdapter.<anonymous> (C:\Users\Marcus Young\Documents\kloudMSTIntegration\node_modules\botbuilder\lib\botFrameworkAdapter.js:677:27) at Generator.next (<anonymous>) at fulfilled (C:\Users\Marcus Young\Documents\kloudMSTIntegration\node_modules\botbuilder\lib\botFrameworkAdapter.js:11:58) at processTicksAndRejections (internal/process/task_queues.js:93:5) (node:2205412) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3) (node:2205412) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected behavior

Give a clear and concise description of what you expected to happen.

I believe the sample search command is supposed to produce a bunch of preview cards in the little popup, but nothing shows up.

Screenshots

MST Search Command 501 Error

Additional context

Add any other context about the problem here.

I did add the command to the manifest.json, ngrok was running and says 501 Not Implemented, and the handleTeamsMessagingExtensionQuery is being hit, I can even console.log the data that's supposed to show up on the search command There is similar issues logged for the extension action commands microsoft/botbuilder-js#1292, microsoft/botbuilder-js#2287 but it seems that the issue on the action side is resolved.

[bug]

jwiley84 commented 4 years ago

Hi @DMarcusYoung Handful of troubleshooting steps:

image

DMarcusYoung commented 4 years ago

Yes it's local, all of the app id and address stuff match. I have working action commands that perform perfectly, and a basic conversation bot, so it's definitely not that.

jwiley84 commented 4 years ago

Can you post your manifest.json with the appid redacted?

DMarcusYoung commented 4 years ago

{ "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.7/MicrosoftTeams.schema.json", "manifestVersion": "1.7", "version": "1.0.14", "id": My app Id, "packageName": "com.kloud.devapp", "developer": { "name": "Kloud", "websiteUrl": "https://kloud.com", "privacyUrl": "https://techexcel.com/privacy-statement/", "termsOfUseUrl": "https://techexcel.com/privacy-statement/" }, "icons": { "color": "color.png", "outline": "outline.png" }, "name": { "short": "Kloud", "full": "Kloud App For Microsoft Teams" }, "description": { "short": "App to increase productivity through Kloud solutions", "full": "Kloud solutions app that provides document video sharing, and sync rooms in addition to video chats." }, "accentColor": "#235EA5", "bots": [ { "botId": "My Bot ID", "scopes": [ "personal", "team", "groupchat" ], "commandLists": [ { "scopes": [ "personal" ], "commands": [ { "title": "Help", "description": "Shows what this bot can do" }, { "title": "Join", "description": "Join Meeting" }, { "title": "Start", "description": "Start Meeting" }, { "title": "Logout", "description": "Logout of Kloud" } ] }, { "scopes": [ "team" ], "commands": [ { "title": "Help", "description": "Shows what this bot can do" }, { "title": "Join", "description": "Join Meeting" }, { "title": "Start", "description": "Start Meeting" }, { "title": "Logout", "description": "Logout of Kloud" } ] }, { "scopes": [ "groupchat" ], "commands": [ { "title": "Help", "description": "Shows what this bot can do" }, { "title": "Join", "description": "Join Meeting" }, { "title": "Start", "description": "Start Meeting" }, { "title": "Logout", "description": "Logout of Kloud" } ] } ], "supportsFiles": true, "isNotificationOnly": false } ], "composeExtensions": [ { "botId": "My Bot Id", "canUpdateConfiguration": true, "commands": [ { "id": "syncRooms", "type": "action", "title": "SyncRooms", "description": "Opens List of Sync Rooms", "initialRun": true, "fetchTask": false, "context": [ "commandBox", "compose" ], "parameters": [ { "name": "test", "title": "Test Param", "description": "", "inputType": "text" } ] }, { "id": "searchSync", "type": "query", "title": "Sync Rooms", "description": "See list of Sync Rooms ", "initialRun": true, "context": [ "commandBox", "compose" ], "parameters": [ { "name": "placeholder", "title": "Placeholder Param", "description": "Type anything and then press enter", "inputType": "text" } ] }, { "id": "listDocs", "type": "action", "title": "Documents", "description": "See list of documents ", "initialRun": true, "fetchTask": false, "context": [ "commandBox", "compose" ], "parameters": [ { "name": "placeholder", "title": "Placeholder Param", "description": "Type anything and then press enter", "inputType": "text" } ] } ] } ], "permissions": [ "identity", "messageTeamMembers" ], "validDomains": [ "kloud.com" ], "devicePermissions": [ "media" ] }

DMarcusYoung commented 4 years ago

Any updates? @jwiley84

jwiley84 commented 4 years ago

I have a feeling that you have something in your manifest that is conflicting with the search function, but given the length of the file will take me a hot minute to find out what it is. Thank you for your patience.

jwiley84 commented 4 years ago

So far, nothing I've seen is conflicting in your manifest. Can I see your main bot, where the you handle the messaging extension query? (in the sample, it's teamsmessagingextensionsearchbot.js)

jwiley84 commented 4 years ago

Closing for lack of response.