Hello,
I've random end of session requests in my skill (around 3 every 100 requests).
The behaviour seems like:
- The user sends a valid intent request. The skill returns an "apparently valid" response.
- The user get this response and does not like it. 300ms later the user does a Session End request with ERROR reason.
How can I debug this behaviour?
There are no crashes on the skill side. I think it might be related to the APL response the skill sends back to the user. I tried to capture it and put it on the visual editor and it was correct.
The details of the error are:
{"type":"INVALID_RESPONSE","message":"An exception occurred while dispatching the request to the skill."}
Skill Id: amzn1.ask.skill.34162947-c2ba-4d39-b048-9621a57b5eca
Thanks to help.
Sample skill response:
{ "body": { "version": "1.0", "response": { "outputSpeech": { "type": "SSML", "ssml": "<speak><voice name=\"Enrique\"><lang xml:lang=\"es-ES\"><say-as interpret-as=\"interjection\">Oh no</say-as>. No has acertado. </lang></voice>The correct answer is 1: <voice name=\"Enrique\"><lang xml:lang=\"es-ES\">Alcalinos</lang></voice>. Let's go to the next question. The question's worth 60 points and the category is history. <voice name=\"Enrique\"><lang xml:lang=\"es-ES\">¿Quién es el autor de esta frase: 'No sé con qué armas se librará la Tercera Guerra Mundial, pero en la Cuarta Guerra Mundial usarán palos y piedras'? 1. Albert Einstein. 2. Winston Churchill. 3. Isaac Asimov. </lang></voice></speak>" }, "card": { "type": "Simple", "title": "¿Quién es el autor de esta frase: 'No sé con qué armas se librará la Tercera Guerra Mundial, pero en la Cuarta Guerra Mundial usarán palos y piedras'?", "content": "1. Albert Einstein\n2. Winston Churchill\n3. Isaac Asimov\n" }, "directives": [ { "type": "Alexa.Presentation.APL.RenderDocument", "document": { "type": "APL", "version": "1.1", "theme": "dark", "import": [ { "name": "alexa-layouts", "version": "1.1.0" } ], "settings": {}, "resources": [ { "description": "Colors for the Splash Card", "colors": { "colorLeft": "#00CAF0", "colorRight": "#E2C744" } }, { "description": "Question card: question", "dimensions": { "questionTitlePaddingLeft": "1vw", "questionTitlePaddingRight": "1vw" } }, { "description": "Question card: question (round)", "when": "${viewport.width < 500}", "dimensions": { "questionTitlePaddingLeft": "5vw", "questionTitlePaddingRight": "5vw", "questionTitlePaddingTop": "25vw" } }, { "description": "Question card: answer", "dimensions": { "answerTablePaddingTop": "2vw", "answerTablePaddingLeft": "10vw", "answerTableNumberSpacing": "2vw" } }, { "description": "Question card: answer (round)", "when": "${viewport.width < 500}", "dimensions": { "answerTablePaddingTop": "2vw", "answerTablePaddingLeft": "12vw", "answerTableNumberSpacing": "1vw" } }, { "description": "Question card: answer (big device)", "when": "${viewport.height > 500}", "numbers": { "answerTableBorderWidth": 3 } } ], "styles": { "splashLeftFilling": { "values": [ { "backgroundColor": "@colorLeft" } ] }, "splashRightFilling": { "values": [ { "backgroundColor": "@colorRight" } ] }, "questionTitle": { "values": [ { "fontSize": "25", "fontWeight": "300" }, { "when": "${viewport.width > 480 }", "fontSize": "35", "fontWeight": "400" }, { "when": "${viewport.width > 960}", "fontSize": "42", "fontWeight": "400" }, { "when": "${viewport.width > 1024}", "fontSize": "55", "fontWeight": "400" }, { "when": "${viewport.width > 1280}", "fontSize": "42", "fontWeight": "400" } ] }, "answerNumber": { "values": [ { "fontSize": "22", "fontWeight": "400" }, { "when": "${viewport.width > 480 }", "fontSize": "35", "fontWeight": "400" }, { "when": "${viewport.width > 960}", "fontSize": "40", "fontWeight": "450" }, { "when": "${viewport.width > 1024}", "fontSize": "55", "fontWeight": "400" }, { "when": "${viewport.width > 1280}", "fontSize": "42", "fontWeight": "400" } ] }, "answerText": { "values": [ { "fontSize": "22", "fontWeight": "300" }, { "when": "${viewport.width > 480 }", "fontSize": "35", "fontWeight": "350" }, { "when": "${viewport.width > 960}", "fontSize": "40", "fontWeight": "400" }, { "when": "${viewport.width > 1024}", "fontSize": "55", "fontWeight": "350" }, { "when": "${viewport.width > 1280}", "fontSize": "42", "fontWeight": "350" } ] } }, "onMount": [ { "type": "AutoPage", "componentId": "mainPager", "duration": 1000, "delay": 2000 } ], "graphics": {}, "commands": {}, "layouts": { "answerItem": { "parameters": [ "answer", "number" ], "items": [ { "type": "Container", "direction": "row", "items": [ { "type": "Text", "style": "answerNumber", "paddingRight": "@answerTableNumberSpacing", "color": "@colorLeft", "text": "${number}." }, { "type": "Text", "style": "answerText", "text": "${answer}" } ] } ] } }, "mainTemplate": { "parameters": [ "payload" ], "items": [ { "type": "Pager", "id": "mainPager", "width": "100%", "height": "100%", "items": [ { "type": "Container", "width": "100%", "height": "100%", "direction": "row", "items": [ { "type": "Frame", "width": "50%", "height": "100%", "style": "splashLeftFilling" }, { "type": "Frame", "width": "50%", "height": "100%", "style": "splashRightFilling" }, { "type": "Image", "width": "100%", "height": "100%", "position": "absolute", "source": "https://s3-eu-west-1.amazonaws.com/pdux.alexa.skills.trivial.public/apl/APP_ICON_LARGE.png" } ] }, { "type": "Container", "width": "100%", "height": "100%", "direction": "column", "items": [ { "when": "${viewport.shape != 'round'}", "type": "AlexaHeader", "headerAttributionImage": "${payload.data.header.logoUrl}", "headerTitle": "${payload.data.header.title}", "width": "100%" }, { "description": "Question Title", "type": "Text", "style": "questionTitle", "paddingLeft": "@questionTitlePaddingLeft", "paddingTop": "@questionTitlePaddingTop", "paddingRight": "@questionTitlePaddingRight", "textAlign": "center", "color": "@colorRight", "text": "${payload.data.question}" }, { "description": "Answer Table", "type": "Container", "direction": "column", "justifyContent": "center", "items": [ { "type": "Sequence", "data": "${payload.data.answers}", "scrollDirection": "vertical", "paddingTop": "@answerTablePaddingTop", "paddingLeft": "@answerTablePaddingLeft", "height": "auto", "items": [ { "type": "Frame", "item": [ { "type": "answerItem", "answer": "${data.answer}", "number": "${data.number}" } ], "borderWidth": "@answerTableBorderWidth" } ] } ] } ] } ] } ] } }, "datasources": { "data": { "header": { "logoUrl": "https://s3-eu-west-1.amazonaws.com/pdux.alexa.skills.trivial.public/apl/trivial-bubble-logo.png", "title": "Trivial master" }, "question": "¿Quién es el autor de esta frase: 'No sé con qué armas se librará la Tercera Guerra Mundial, pero en la Cuarta Guerra Mundial usarán palos y piedras'?", "answers": [ { "number": "1", "answer": "Albert Einstein" }, { "number": "2", "answer": "Winston Churchill" }, { "number": "3", "answer": "Isaac Asimov" } ] } } } ], "reprompt": { "outputSpeech": { "type": "SSML", "ssml": "<speak><voice name=\"Enrique\"><lang xml:lang=\"es-ES\">¿Quién es el autor de esta frase: 'No sé con qué armas se librará la Tercera Guerra Mundial, pero en la Cuarta Guerra Mundial usarán palos y piedras'? 1. Albert Einstein. 2. Winston Churchill. 3. Isaac Asimov. </lang></voice></speak>" } }, "shouldEndSession": false, "type": "_DEFAULT_RESPONSE" }, "sessionAttributes": { "score": 0, "previousQuestions": { "35598e8f-3124-5481-a30a-e3be2a21d2e1": { "time": 10011, "correct": false, "answer": 2, "repetitions": 0 }, "95d02b31-a679-53b5-ab87-79e5f9004fc6": { "answer": null }, "0b390053-b38e-57ce-a00f-9930a56fc682": { "time": 10736, "correct": false, "answer": 2, "repetitions": 0 }, "2f843622-f67c-56f7-b386-e383d159661b": { "correct": false, "answer": 2, "repetitions": 0, "time": 11338 } }, "previousGames": [ { "questions": { "140c5ba5-3644-59d7-a80f-da91be2a17b4": { "time": 12301, "correct": true, "answer": 0, "repetitions": 0 }, "795620b9-7335-5331-b465-88c32662698a": { "answer": null }, "2196a3cb-0f16-5c68-b4aa-6c8d0c847eaf": { "time": 9251, "correct": false, "answer": 1, "repetitions": 0 }, "3be2bfa7-875c-5d11-ba27-df812cf5c6f1": { "time": 12020, "correct": false, "answer": 1, "repetitions": 0 }, "65d32a7b-ef56-5aef-a910-124c41609383": { "time": 16293, "correct": false, "answer": 2, "repetitions": 0 } }, "score": 1, "pointScore": 65 }, { "questions": { "f928211b-3565-5208-b352-45880bb82f3d": { "time": 24635, "correct": false, "answer": 1, "repetitions": 0 }, "b4c16133-fcd9-5ea6-a24c-93951a31d6b9": { "time": 12970, "correct": true, "answer": 1, "repetitions": 0 }, "110bb9b9-95da-5576-bd11-6fba8ee51d11": { "time": 14654, "correct": true, "answer": 1, "repetitions": 0 }, "adccbfbf-56a8-5586-adf7-1a47fbcb584b": { "time": 29561, "correct": false, "answer": 0, "repetitions": 0 }, "4dcf41a3-e67d-5ef4-b769-fc8dd50ee18b": { "time": 9436, "correct": false, "answer": 1, "repetitions": 0 } }, "score": 2, "pointScore": 130 }, { "questions": { "059b6a12-7b33-5c39-b930-7b4b871f10da": { "time": 22483, "correct": true, "answer": 1, "repetitions": 0 }, "be91fb7d-82d4-57ea-b922-d0c660621beb": { "time": 14814, "correct": true, "answer": 2, "repetitions": 0 }, "19a1c7b6-5597-5a06-a12a-fa4f6a88f45f": { "time": 28750, "correct": true, "answer": 1, "repetitions": 0 }, "dc6dde56-b03e-52c5-aacd-01dc86e5a33b": { "time": 19326, "correct": true, "answer": 2, "repetitions": 0 }, "79aea250-14bf-5496-b83a-5ca870a1acd8": { "time": 30162, "correct": false, "answer": 1, "repetitions": 0 } }, "score": 4, "pointScore": 240 } ], "pointScore": 0, "answerIndexMap": [ 1, 0, 2 ], "currentQuestion": { "id": "29800efd-cf82-5724-a958-bf1292a5ed3b", "question": "¿Quién es el autor de esta frase: 'No sé con qué armas se librará la Tercera Guerra Mundial, pero en la Cuarta Guerra Mundial usarán palos y piedras'?", "repetitions": 0, "time": 1568540057587 }, "totalScore": 7, "player": { "score": { "score": 435, "rank": 299, "ordinalRank": "299th", "matchId": "86c3e7cc-8bb8-436f-980d-0cafe9678302" }, "profile": { "name": "Selfishly Jittery Mouse", "color": "a6982d", "avatar": "http://s3-eu-west-1.amazonaws.com/pdux.alexa.skills.trivial.public/avatar/3149.png" }, "sessionApiKey": "e09c7f65-3894-4776-87d1-2a452ac9ec15", "sessionId": "0f01e439-71a0-4a9e-8d11-030f93a6f83b", "sessionExpirationDate": 1568062079357, "playerToken": "2bf354e8-74a7-4cea-9af1-4c3b87139087", "externalPlayerId": "af1a9cc6-4673-457d-80d2-2b36aa09b116" }, "points": { "category": { "Geography": { "combo": 0, "total": 121 }, "Science": { "combo": 0, "total": 59 }, "Literature": { "combo": 1, "total": 65 }, "History": { "combo": 1, "total": 65 }, "Culture": { "combo": 0, "total": 0 }, "Sports": { "combo": 1, "total": 125 } }, "combo": 0, "total": 435 } }, "userAgent": "ask-node/2.7.0 Node/v10.16.3" } }