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

[MSTeams] Unable to connect to nodejs QnA bot in Azure - "Sorry, there was a problem encountered with your request"

Open digitalanalogue9 opened this issue 9 years ago • 4 comments

Bot Info

  • Bot handle: CommsTech
  • App ID: ca89020e-07ec-4722-ac08-dc3e831d5121
  • SDK Platform: NodeJs
  • SDK Version: 6.5.0
  • Active Channels: MS Teams, Web Chat
  • Deployment Environment: Azure App Service

Issue Description

I created a QnA Bot using the nodejs template. Tested it successfully from dev.botframework.com. The url has a code querystring - I wasn't sure why that was.

I added the bot to MS Teams but when I tested it in teams but get an error response.

Code Example

`// For more information about this template visit http://aka.ms/azurebots-node-qnamaker

"use strict"; var builder = require("botbuilder"); var botbuilder_azure = require("botbuilder-azure"); var builder_cognitiveservices = require("botbuilder-cognitiveservices"); var path = require('path');

var useEmulator = (process.env.NODE_ENV == 'development');

var connector = useEmulator ? new builder.ChatConnector() : new botbuilder_azure.BotServiceConnector({ appId: process.env['MicrosoftAppId'], appPassword: process.env['MicrosoftAppPassword'], stateEndpoint: process.env['BotStateEndpoint'], openIdMetadata: process.env['BotOpenIdMetadata'] });

var bot = new builder.UniversalBot(connector); bot.localePath(path.join(__dirname, './locale'));

var recognizer = new builder_cognitiveservices.QnAMakerRecognizer({ knowledgeBaseId: process.env.QnAKnowledgebaseId, subscriptionKey: process.env.QnASubscriptionKey});

var basicQnAMakerDialog = new builder_cognitiveservices.QnAMakerDialog({ recognizers: [recognizer], defaultMessage: 'No match! Try changing the query terms!', qnaThreshold: 0.3} );

bot.dialog('/', basicQnAMakerDialog);

if (useEmulator) { var restify = require('restify'); var server = restify.createServer(); server.listen(3978, function() { console.log('test bot endpont at http://localhost:3978/api/messages'); }); server.post('/api/messages', connector.listen());
} else { module.exports = { default: connector.listen() } } `

Reproduction Steps

1.Set up QnA 2.Use Azure to create a nodejs Bot using the QnATemplate 3.Add to teams 4.Say Hi

Expected Behavior

The bot to respond hi

Actual Results

The bot replied "Sorry, there was a problem encountered with your request"

digitalanalogue9 avatar Sep 13 '17 21:09 digitalanalogue9

@DanHibbert I was able to chat with your bot and receive the generic "No match! Try changing the query terms!" message. Are you still receiving an error when trying to talk with your bot?

stevengum avatar Sep 20 '17 22:09 stevengum

Closing issue due to lack of response.

stevengum avatar Sep 28 '17 03:09 stevengum

Im having the same issue with my bot, i created the bot with QnA maker. I can add the bot to my private chats in Teams and talk to the bot without any errors. When i add the bot to a team, it doesnt respond to my messages. The only message i get is: Sorry, there was a problem encountered with your request. My callback URL is: https://officebottesting.azurewebsites.net/api/messages

iantje31 avatar Oct 06 '17 12:10 iantje31

@iantje31 please open a new issue for this

JasonSowers avatar Oct 06 '17 15:10 JasonSowers