{"action":"created","issue":{"url":"https://api.github.com/repos/joanaz/MirrorMirrorOnTheWallSkill/issues/20","repository_url":"https://api.github.com/repos/joanaz/MirrorMirrorOnTheWallSkill","labels_url":"https://api.github.com/repos/joanaz/MirrorMirrorOnTheWallSkill/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/joanaz/MirrorMirrorOnTheWallSkill/issues/20/comments","events_url":"https://api.github.com/repos/joanaz/MirrorMirrorOnTheWallSkill/issues/20/events","html_url":"https://github.com/joanaz/MirrorMirrorOnTheWallSkill/issues/20","id":290694789,"number":20,"title":"Lambda Response Service Simulator Error","user":{"login":"qgoehrig","id":11185459,"avatar_url":"https://avatars0.githubusercontent.com/u/11185459?v=4","gravatar_id":"","url":"https://api.github.com/users/qgoehrig","html_url":"https://github.com/qgoehrig","followers_url":"https://api.github.com/users/qgoehrig/followers","following_url":"https://api.github.com/users/qgoehrig/following{/other_user}","gists_url":"https://api.github.com/users/qgoehrig/gists{/gist_id}","starred_url":"https://api.github.com/users/qgoehrig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgoehrig/subscriptions","organizations_url":"https://api.github.com/users/qgoehrig/orgs","repos_url":"https://api.github.com/users/qgoehrig/repos","events_url":"https://api.github.com/users/qgoehrig/events{/privacy}","received_events_url":"https://api.github.com/users/qgoehrig/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-01-23T03:14:46Z","updated_at":"2018-03-05T13:24:51Z","closed_at":null,"author_association":"NONE","body":"This is a copy of an Issue I created on the MirrorMirrorOnTheWallSkill Github page.\r\n\r\nIt seems that there are a few other issues addressing this issue that don't have fixes, so I'd figure I'd post my issue with as a detailed report. The Lambda Response from the service simulator in the Skill test returns the following error.\r\n\r\n``The  remote endpoint could not be called, or the response it returned was invalid.``\r\n\r\n\r\nMy lambda request is as follows with a few fields omitted:\r\n\r\n```\r\n{\r\n  \"session\": {\r\n    \"new\": true,\r\n    \"sessionId\": \"MY-SESSION-ID\",\r\n    \"application\": {\r\n      \"applicationId\": \"MY-APP-ID\"\r\n    },\r\n    \"attributes\": {},\r\n    \"user\": {\r\n      \"userId\": \"MY-USER-ID\"\r\n    }\r\n  },\r\n  \"request\": {\r\n    \"type\": \"IntentRequest\",\r\n    \"requestId\": \"EdwRequestId.486a3b43-cf13-46c0-a696-cfc9ba39725a\",\r\n    \"intent\": {\r\n      \"name\": \"MirrorMirrorHelloIntent\",\r\n      \"slots\": {}\r\n    },\r\n    \"locale\": \"en-US\",\r\n    \"timestamp\": \"2018-01-23T03:04:11Z\"\r\n  },\r\n  \"context\": {\r\n    \"AudioPlayer\": {\r\n      \"playerActivity\": \"IDLE\"\r\n    },\r\n    \"System\": {\r\n      \"application\": {\r\n        \"applicationId\": \"MY-CORRECT-APP-ID\"\r\n      },\r\n      \"user\": {\r\n        \"userId\": \"MY-USER-ID\"\r\n      },\r\n      \"device\": {\r\n        \"supportedInterfaces\": {}\r\n      }\r\n    }\r\n  },\r\n  \"version\": \"1.0\"\r\n}\r\n```\r\n\r\nDiving further into the Invocation Logs in AWS lambda (as seen through CloudWatch), I get the following error stack trace:\r\n\r\n\r\nmodule initialization error: Error\r\nat new DeviceClient (/var/task/node_modules/aws-iot-device-sdk/device/index.js:445:13)\r\nat Object.DeviceClient [as device] (/var/task/node_modules/aws-iot-device-sdk/device/index.js:216:14)\r\nat Object.app.setup (/var/task/MirrorMirror.js:11:23)\r\nat Object.<anonymous> (/var/task/index.js:21:14)\r\nat Module._compile (module.js:570:32)\r\nat Object.Module._extensions..js (module.js:579:10)\r\nat Module.load (module.js:487:32)\r\nat tryModuleLoad (module.js:446:12)\r\nat Function.Module._load (module.js:438:3)\r\nat Module.require (module.js:497:17)\r\n\r\nOn the last bit of the exception in /node_modules/aws-iot-device-sdk/device/index.js, the error that is being throw is from\r\n```\r\nif (isUndefined(option.host)) {\r\n    throw new Error(exceptions.INVALID_CONNECT_OPTIONS);\r\n}\r\n```\r\n\r\nPerhaps this can offer some insight as to where I'm going wrong here.\r\n\r\nI feel that there are many users here like myself who are still struggling to get past this point, so any help is greatly appreciated!\r\n"},"comment":{"url":"https://api.github.com/repos/joanaz/MirrorMirrorOnTheWallSkill/issues/comments/370417633","html_url":"https://github.com/joanaz/MirrorMirrorOnTheWallSkill/issues/20#issuecomment-370417633","issue_url":"https://api.github.com/repos/joanaz/MirrorMirrorOnTheWallSkill/issues/20","id":370417633,"user":{"login":"XerqJon","id":3145572,"avatar_url":"https://avatars3.githubusercontent.com/u/3145572?v=4","gravatar_id":"","url":"https://api.github.com/users/XerqJon","html_url":"https://github.com/XerqJon","followers_url":"https://api.github.com/users/XerqJon/followers","following_url":"https://api.github.com/users/XerqJon/following{/other_user}","gists_url":"https://api.github.com/users/XerqJon/gists{/gist_id}","starred_url":"https://api.github.com/users/XerqJon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XerqJon/subscriptions","organizations_url":"https://api.github.com/users/XerqJon/orgs","repos_url":"https://api.github.com/users/XerqJon/repos","events_url":"https://api.github.com/users/XerqJon/events{/privacy}","received_events_url":"https://api.github.com/users/XerqJon/received_events","type":"User","site_admin":false},"created_at":"2018-03-05T13:24:51Z","updated_at":"2018-03-05T13:24:51Z","author_association":"NONE","body":"There is something missing that someone else identified as being required for this to work. Prior to uploading the .zip file created in step 3 to Lambda, edit the **/src/MirrorMirror.js** file and add a new line under `region: \"us-east-1\",` (~line 16) and add `host: \"YOURID.iot.us-east-1.amazonaws.com\",` so the entire section looks like this:\r\n```\r\napp.setup = function() {\r\n  app.device = awsIot.device({\r\n    keyPath: __dirname + \"/certs/MagicMirror.private.key\",\r\n    certPath: __dirname + \"/certs/MagicMirror.cert.pem\",\r\n    caPath: __dirname + \"/certs/root-CA.crt\",\r\n    clientId: \"MirrorMirror\" + (new Date().getTime()),\r\n    region: \"us-east-1\",\r\n\thost: \"YOURID.iot.us-east-1.amazonaws.com\",\r\n  });\r\n```\r\nYou need to get your IOT endpoint created at the beginning for that line - to do that, go to [AWS > IoT > Settings](https://console.aws.amazon.com/iot/home?region=us-east-1#/settings) and copy the value under Custom Endpoint.\r\nCredit to [torresfm](https://forum.magicmirror.builders/topic/4294/mirrormirroronthewall-alexa-skill-trouble/4?page=1)\r\n\r\nAfter making that addition, save the _MirrorMirror.js_ file and then create your zip for upload."}}
{"actor":{"display_login":"XerqJon"}}