Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMadhan Karthik
4,239 PointsHow to resolve the "Process exited before completing request" issue
I'm using the zip file which you uploaded in the treehouse and just changed the definition and response JSON file. But I'm getting "Process exited before completing request" error after uploading the file. Any help would be appreciated.
Response from AWS:
START RequestId: 4c07172f-2323-11e7-addc-4b2286ac1f3d Version: $LATEST
2017-04-17T04:06:57.178Z 4c07172f-2323-11e7-addc-4b2286ac1f3d TypeError: Cannot read property 'locale' of undefined
at AlexaRequestEmitter.HandleLambdaEvent (/var/task/node_modules/alexa-sdk/lib/alexa.js:102:38)
at AlexaRequestEmitter.value (/var/task/node_modules/alexa-sdk/lib/alexa.js:91:31)
at exports.handler (/var/task/index.js:48:11)
END RequestId: 4c07172f-2323-11e7-addc-4b2286ac1f3d
REPORT RequestId: 4c07172f-2323-11e7-addc-4b2286ac1f3d Duration: 130.56 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 28 MB
RequestId: 4c07172f-2323-11e7-addc-4b2286ac1f3d Process exited before completing request
Thanks in advance Madhan
3 Answers
Andrew Chalkley
Treehouse Guest TeacherCan you paste the contents of the definition and response so we an take a look at your code?
Madhan Karthik
4,239 Pointsdefinition.JSON
{
"Arrow": "A shafted projectile that is shot with a bow",
"Arrowhead": "The front end of an arrow; also known as the head, point or tip",
"Arrow rest": "A device used to hold the arrow against the handle until it is released",
"Fletching": "The stabilizing fins or vanes of an arrow",
"Head": "The front end of an arrow; also known as the arrowhead, point or tip",
"Index fletching": "A differently-coloured fletch that indicates proper arrow alignment",
"Nock": "The notch at the rear end of an arrow; also the notches at the ends of the bow limbs to which the bowstring is attached, or looped over",
"Point": "The front end of an arrow; also known as the arrowhead, head or tip",
"Shaft": "Part of the arrow upon which the fletchings lie",
"Vane": "The stabilizing fin of an arrow"
}
response.JSON
{
"LaunchRequest":
{
"ask":"Welcome to ArcheryTerm. What would you like to know?",
"reprompt": "What would you like to know?"
},
"AMAZON.HelpIntent":
{
"ask": "Here are some things you can say: What is the definition of HTML? Or what is the definition of JavaScript? What would you like to know?",
"reprompt": "What would you like to know?"
},
"AMAZON.StopIntent":
{
"tell": "See ya! Keep learning!"
}
}
Andrew Chalkley
Treehouse Guest TeacherThat JSON looks fine, I re zipped up your definitions and responses with the code and tested it and it worked. Here's the zip file I used.
John Marsden John Marsden
2,691 PointsJohn Marsden John Marsden
2,691 PointsMadhan you will most likely be getting this error if you are using the save and test function from with in lambda it's self as the test helloworld json,
{ "key3": "value3", "key2": "value2", "key1": "value1" }
does not contain the right keys. The alexa skill function is complaining as the event object does not contain a request object and therefore cant find the locale key which just happens to be one of the first keys it checks in the object so it errors out on that one first.Incase you are interested I have included a sample of the request object here so you can see that locale is one of the keys:
"request": { "type": "IntentRequest", "requestId": "xxxxxxxx", "locale": "en-US", "timestamp": "2017-04-27T13:06:29Z", "intent": { "name": "GetDefinition", "slots": { "Term": { "name": "Term", "value": "HTML" } } }
You can ignore this error inside lambda and run your test from your Alexa skill and it should run fine. If you get a timeout error when running the test then switch back to the lambda skill console and go to the configure section and set your timeout from the default 3 seconds to 7 seconds.