MagicMirror² v2.4.1 is available! For more information about this release, check out this topic.
Please read the release notes carefully since this update requires adjustments to your Raspberry Pi configuration!

MirrorMirrorOnTheWallSkill - Lambda Response Service Simulator Error



  • This is a copy of an Issue I created on the MirrorMirrorOnTheWallSkill Github page.

    It 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.

    The remote endpoint could not be called, or the response it returned was invalid.

    My lambda request is as follows with a few fields omitted:

    {
      "session": {
        "new": true,
        "sessionId": "MY-SESSION-ID",
        "application": {
          "applicationId": "MY-APP-ID"
        },
        "attributes": {},
        "user": {
          "userId": "MY-USER-ID"
        }
      },
      "request": {
        "type": "IntentRequest",
        "requestId": "EdwRequestId.486a3b43-cf13-46c0-a696-cfc9ba39725a",
        "intent": {
          "name": "MirrorMirrorHelloIntent",
          "slots": {}
        },
        "locale": "en-US",
        "timestamp": "2018-01-23T03:04:11Z"
      },
      "context": {
        "AudioPlayer": {
          "playerActivity": "IDLE"
        },
        "System": {
          "application": {
            "applicationId": "MY-CORRECT-APP-ID"
          },
          "user": {
            "userId": "MY-USER-ID"
          },
          "device": {
            "supportedInterfaces": {}
          }
        }
      },
      "version": "1.0"
    }
    

    Diving further into the Invocation Logs in AWS lambda (as seen through CloudWatch), I get the following error stack trace:

    module initialization error: Error
    at new DeviceClient (/var/task/node_modules/aws-iot-device-sdk/device/index.js:445:13)
    at Object.DeviceClient [as device] (/var/task/node_modules/aws-iot-device-sdk/device/index.js:216:14)
    at Object.app.setup (/var/task/MirrorMirror.js:11:23)
    at Object. (/var/task/index.js:21:14)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions…js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)

    On the last bit of the exception in /node_modules/aws-iot-device-sdk/device/index.js, the error that is being throw is from

    if (isUndefined(option.host)) {
        throw new Error(exceptions.INVALID_CONNECT_OPTIONS);
    }
    

    Perhaps this can offer some insight as to where I’m going wrong here.

    I feel that there are many users here like myself who are still struggling to get past this point, so any help is greatly appreciated!