【问题标题】:Bot Framework Getting Internal Error Code 500Bot Framework 获取内部错误代码 500
【发布时间】:2016-04-05 08:10:46
【问题描述】:

我想试试微软的新机器人框架。我制作了一个简单的机器人并将其注册到机器人连接器中。 当我现在想在 dev.framework.com 网站上测试我的机器人时,我收到了这条消息:

{
 "error": {
    "code": "Internal",
    "message": "An error occurred while sending the request. Unable to connect to the remote server An attempt was made to access a socket in a way forbidden by its access permissions 172.17.1.41:3978  [GSisZ6ZkL7d]",
    "statusCode": 500
 }
}

这是我的 app.js:

var builder = require('botbuilder');
var restify = require('restify');
var index = require('./dialogs/index.js');

var bot = new builder.BotConnectorBot({ appId: 'myAppId', appSecret: 'myAppSecret' });
bot.add('/', index);

var server = restify.createServer();
server.post('/api/messages',  bot.listen());
server.listen(process.env.port || 8080, process.env.ip, bot.verifyBotFramework(), function () {
    console.log('%s listening to %s', server.name, server.url); 
});

当我在 openshift 上运行我的应用程序时,我得到控制台日志“restify listen to https://myipaddress:8080”,所以我猜我的节点应用程序正在运行。

我还尝试将 https 和 http 作为端点调用 bot.verifyBotFramework() 和不调用。

【问题讨论】:

  • 似乎端点映射到了错误的端口 (3978) 但 OpenShift 可能只允许端口 8080 从公共网络连接?

标签: node.js openshift botframework


【解决方案1】:

尝试在本地模拟器中使用 http 而不是 https

【讨论】:

    【解决方案2】:

    bot.verifyBotFramework() 调用只会通过 HTTPS 启动,如果您的 AppID 或 AppSecret 错误,将返回 403。如果您尝试通过实际的 Bot Connector 服务进行调用,我可以保证它们是错误的,但它们应该可以在模拟器上正常工作。不过,我不确定您为什么会收到 500 错误。除了 AppID 和 AppSecret 是模拟器使用的默认值之外,我觉得一切正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-31
      • 1970-01-01
      • 2019-09-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多