0

Well, I am having an issue that I've been dealing with for the last 2 days and still seem to have no progress on.

Basically, I am trying to develop a skill for Amazon's echo dot, but my particular skill requires the use of persistent data. I took to the docs and found information on account linking and DynamoDB, account linking seemed to complex for a simple research project so I took to DynamoDB.

I used a lambda function, and it ran fine until I put the DynamoDB table line:

alexa.dynamoDBTableName = 'rememberThisDB';

That line completely stops my skill from working and returns the following message:

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

I honestly have no idea how to deal with it; I am completely new to the whole AWS concept so I don't even know how to get the actual error message that the Lambda function is returning.

I changed the role and gave it the following configuration:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "logs:CreateLogGroup",
        "logs:CreateLogStream",
        "logs:PutLogEvents"
      ],
      "Resource": "arn:aws:logs:*:*:*"
    },
        {
            "Effect": "Allow",
            "Action": [
                "dynamodb:DeleteItem",
                "dynamodb:GetItem",
                "dynamodb:PutItem",
                "dynamodb:Scan",
                "dynamodb:UpdateItem"
            ],
            "Resource": "*Yes, I did put the correct ARN*"
        }
  ]
}

But that didn't really change anything, it still just returned the same error.

The issue is, I'm not doing anything at all with DynamoDB, I am simply defining the dynamoDBTableName property of the alexa object, that's it.

Yes, the DynamoDB table exists.

I feel like my head is about to blow up, so any help would be greatly appreciated.

UPDATE: Found out how to see logs, here is the latest log: Error fetching user state: ValidationException: The provided key element does not match the schema, not sure why it would give that error since I never queried anything, the only thing I did was declare the table name.

3
  • 1
    What is the schema of your table? Assuming you're using the alexa-skills-kit-sdk-for-nodejs, your table should have a single userId string HASH key. Commented Feb 25, 2017 at 16:33
  • Just checked and I had an id primary index, but not an userId, after adding it it started working again. I did not see it documented on the Readme. Thank you so much, you're a life saver Commented Feb 25, 2017 at 16:37
  • Hi Alexander, I have the same issue. Have you found a solution for that? :) Commented May 5, 2017 at 11:38

1 Answer 1

1

Just to document the resolution of the question in the comments and so that this question doesn't remain "unanswered" on SO:

Assuming you're using the alexa-skills-kit-sdk-for-nodejs, your table should have a single userId string HASH key.

var newTableParams = {
    AttributeDefinitions: [
        {
            AttributeName: 'userId',
            AttributeType: 'S'
        }
    ],
    KeySchema: [
        {
            AttributeName: 'userId',
            KeyType: 'HASH'
        }
    ],
    ProvisionedThroughput: {
        ReadCapacityUnits: 5,
        WriteCapacityUnits: 5
    }
}

It turned out the user did not have the appropriate schema setup for their DynamoDB table.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.