【问题标题】:AWS Lambda giving "Process exited before completing request"AWS Lambda 给出“在完成请求之前退出进程”
【发布时间】:2017-06-18 18:37:42
【问题描述】:

我有以下代码要上传到 lambda,它一直给我错误:“errorMessage”:“RequestId: bdfa695d-e8b8-11e6-952a-21bb5e95cff6 Process exited before completed request”,即使我'已经从完美的工作技能修改了这段代码。 代码只是告诉用户你好(用卡片),当用户说问我一个问题时,可以问他们一个问题。这是我的代码: `

var APP_ID=undefined;

var Alexa = require('./AlexaSkill');

var Sample = function () {
    AlexaSkill.call(this, APP_ID);
};

var handlers = {
    'LaunchRequest': function () {

        this.emit(':ask', welcomeMessage, GetReprompt());
},
'Unhandled': function () {
    this.emit(':ask', welcomeMessage, GetReprompt());
},

'AMAZON.HelpIntent': function () {
    this.emit(':ask', HelpMessage, HelpMessage);
},

'AMAZON.StopIntent': function () {
    this.shouldEndSession = true;
    this.emit(':tell', stopSkillMessage, stopSkillMessage);
},

'AMAZON.CancelIntent': function () {
    this.shouldEndSession = true;
    this.emit(':tell', stopSkillMessage, stopSkillMessage);
},

'SaySomethingIntent': function () {

    var speechOutput= "Hello";
    var repromptOutput= "Say hello";
    var cardTitle="Hello. This is the card title.";
    var overviewMessage="This is a card.";
    this.askWithCard(speechOutput, repromptOutput, howToPlayCardTitle, overviewMessage);
},

'AskIntent': function () {

    var question="Hi there, what's your name?";
    this.askWithCard(question);
}
}

exports.handler = function (event, context) {

    var sample = new Sample();
    sample.execute(event, context);
};

` 任何类型的帮助,甚至任何使用 aws 的提示,将不胜感激。谢谢。

【问题讨论】:

  • 您能看看这个 Lambda 的 CloudWatch 日志吗?通常如果有错误,它会在那里打印出来。

标签: javascript amazon-web-services aws-lambda alexa alexa-skill


【解决方案1】:

您的 Lambda 函数应回调 AWS 以通知 Lambda 它已完成所有工作。

在当前版本的 Lambda Nodejs 运行时,您可以调用处理程序的第三个参数callback

http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html

在以前版本的 Nodejs 运行时中,或者如果您的处理程序没有采用 callback 参数,您应该在它退出之前调用 context.succeed()context.fail()

http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-using-old-runtime.html

【讨论】:

    猜你喜欢
    • 2018-03-25
    • 1970-01-01
    • 2015-08-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多