Skip to content
This repository has been archived by the owner. It is now read-only.

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

Closed
smach opened this issue Dec 26, 2016 · 11 comments

Comments

Projects
None yet
5 participants
@smach
Copy link

commented Dec 26, 2016

I thought I followed all the steps, renaming the app both within the index.js and the developer portal. and changing the calendar file URL to one that I am subscribed to. I receive this error msg when trying to test:

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

My cloud log says

Unable to import module 'index': Error
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/var/task/index.js:2:12)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)

I have an index.js file. I'm on Windows, and am zipping the contents of the src directory and not the directory itself, per the tutorial instructions.. Any advice most appreciated!

Update: I tried running through the tutorial again without changing ANYTHING - didn't change app name, didn't change calendar URL - and I'm having the same problem. The much easier Hello World tutorial worked, though.

Note: I now got to the point where I have a similar problem to another issue, so I'm closing this one and moving comments to that thread.

@smach smach closed this Dec 27, 2016

@su7edja

This comment has been minimized.

Copy link

commented Jan 2, 2017

@smach did you resolve this? I'm having the same problem. When I look at the log output in the lambda console, it's telling me that it's because of "locale".

I created an issue #17 and then closed thinking that it was because I installed the packages in the wrong dir, but after following the steps exactly like the tutorial, I'm still getting the same error.

Did you get the same error output as I did? (the error log is pasted in issue #17 )

@su7edja

This comment has been minimized.

Copy link

commented Jan 2, 2017

@smach did you install ical yet?

@smach

This comment has been minimized.

Copy link
Author

commented Jan 2, 2017

@su7edja Yes, I installed ical with npm - wish that had been mentioned in the tutorial instructions - and added

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

The app will "run" but only gives the opening help message, it won't read the calendar.

@su7edja

This comment has been minimized.

Copy link

commented Jan 2, 2017

You got it to run? I can't get it to run at all. When I issued the command "open events calendar", the lambda response I got is "The remote endpoint could not be called, or the response it returned was invalid."

Any idea how I can solve this?

@smach

This comment has been minimized.

Copy link
Author

commented Jan 2, 2017

@su7edja Did you add that code I mentioned above, which is in another issue? You add it in the adding session handlers section. That's how I got it to run, but it still won't read the calendar, it just keeps giving the help message. Not very useful.

@su7edja

This comment has been minimized.

Copy link

commented Jan 3, 2017

Yea I added that (I added the changes made PR 11 and PR 9) but I'm still getting the same error I was getting before. My error log looks different from yours. I wasn't getting error about Unhandled at all.

Here's my error:

START RequestId: c4811616-d158-11e6-93d1-4d02c51fb2b2 Version: $LATEST
2017-01-03T02:03:07.411Z	c4811616-d158-11e6-93d1-4d02c51fb2b2	TypeError: Cannot read property 'locale' of undefined
    at AlexaRequestEmitter.HandleLambdaEvent (/var/task/node_modules/alexa-sdk/lib/alexa.js:102:38)
    at AlexaRequestEmitter.Object.defineProperty.value (/var/task/node_modules/alexa-sdk/lib/alexa.js:91:31)
    at exports.handler (/var/task/index.js:288:11)
END RequestId: c4811616-d158-11e6-93d1-4d02c51fb2b2
REPORT RequestId: c4811616-d158-11e6-93d1-4d02c51fb2b2	Duration: 114.34 ms	Billed Duration: 200 ms 	Memory Size: 128 MB	Max Memory Used: 35 MB	
RequestId: c4811616-d158-11e6-93d1-4d02c51fb2b2 Process exited before completing request
@smach

This comment has been minimized.

Copy link
Author

commented Jan 3, 2017

@nicolaerusan

This comment has been minimized.

Copy link

commented Jan 10, 2017

I'm hitting the same error as @su7edja . Looks like npm installed the files is installed in the correct directory and zipping up accordingly. Any further guidance?

@su7edja

This comment has been minimized.

Copy link

commented Jan 10, 2017

@nicolaerusan Yeah it's actually resolved here: #17

You don't need to make any changes to the code because they are already fixed in master (you're fine as long as your local copy is up to date). It's just kinda iffy when you use the Stanford calendar, but it's more consistent if you use a smaller calendar.

@katariarahul

This comment has been minimized.

Copy link

commented Apr 14, 2017

Hi,
i am working on to setup scorekeeper for alexa from the link
https://github.com/amzn/alexa-skills-kit-java/blob/master/samples/src/main/java/scorekeeper/README.md.

I have setup everything as mentioned in the link but while doing testing from Service Simulator, i am getting following error in lambda (CloudWatch)

Class not found: scorekeeper.ScoreKeeperSpeechletRequestStreamHandler: class java.lang.ClassNotFoundException
java.lang.ClassNotFoundException: scorekeeper.ScoreKeeperSpeechletRequestStreamHandler
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)

Can you please guide in getting this resolve. Thanks.

@Avantol13

This comment has been minimized.

Copy link

commented Oct 14, 2017

For those of you still looking for the solution to the "remote endpoint" issue, relevant information on the Magic Mirror forums.

user/torresfm explains:
In the MirrorMirror.js file you need to add an extra line to point to the aws-iot endpoint you created in the very first steps. You can find the string in the aws-iot dashboard and clicking on settings in the bottom left hand corner.

Mirrormirror.js:

app.setup = function() {
  app.device = awsIot.device({
    keyPath: __dirname + "/certs/MagicMirror.private.key",
    certPath: __dirname + "/certs/MagicMirror.cert.pem",
    caPath: __dirname + "/certs/root-CA.crt",
    clientId: "MirrorMirror" + (new Date().getTime()),
    region: "us-east-1",
    host: "your-custom-endpoint",
  });

The string should look something like this:

xxxxxxxxxxxx.iot.us-east-1.amazonaws.com

Go to AWS console, AWS IoT, Manage, Interact, find HTTPS Rest API Endpoint.
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.