Troubleshooting Amazon's Alexa Skill Kit (ASK) Lambda interaction

瘦欲@ 提交于 2019-12-01 22:44:39

tl;dr: The remote endpoint could not be called, or the response it returned was invalid. also means there may have been a timeout waiting for the endpoint.

I was able to narrow it down to a timeout. Seems like the Alexa service simulator (and the Alexa itself) is less tolerant to long responses than the lambda testing console. During development I had increased the timeout of ARN:1 to 30 seconds (whereas I believe the default is 3 seconds). The DynamoDB table used by ARN:1 has more data and it takes slightly longer to process than ARN:3 which has an almost empty table. As soon as I commented out some of the data loading stuff it was running slightly faster and the Alexa service simulator was working again. I can't find the time budget documented anywhere, I'm guessing 3 seconds? I most likely need to move to another backend, DynamoDB+Python on lambda is too slow for very trivial requests.

Unrelated to python, but I have found the same issue occurs for me if I do not have a handler for a specified intent:

  # lets pretend intentName is actually 'FooBarIntent'
  if (intentName == 'TestIntent') {
    handleTestRequest(intent, session, callback);
  } else {
    throw "Invalid intent"; 
  }

From here, amazon was barking that my lambda was invalid. For others it could indicate an error is being thrown earlier in the stack.

You can also log out your lambda errors with aws cloudwatch which will reveal any warnings or errors.


check out my repo, alexa lambda starter kit for a a simple hello world ask/lambda example.

I think the problem you having for ARN:1 is you probably didn't set a trigger to alexa skill in your lambda function.

Or it can be the alexa session timeout which is by default set to 8 seconds.

My guess would be that you missed a step on setup. There's one where you have to set the "event source". IF you don't do that, I think you get that message.

But the debug options are limited. I wrote EchoSim (the original one on GitHub) before the service simulator was written and, although it is a bit out of date, it does a better job of giving diagnostics.

Lacking debug options, the best is to do what you've done. Partition and re-test. Do static replies until you can work out where the problem is.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!