Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local debugging of skills using persistent storage not working #259

Open
voco-dev opened this issue Apr 27, 2023 · 3 comments
Open

local debugging of skills using persistent storage not working #259

voco-dev opened this issue Apr 27, 2023 · 3 comments

Comments

@voco-dev
Copy link

Desktop (please complete the following information):

  • OS: Windows 11
  • VS Code version: 1.77.3
  • Alexa Skill Toolkit extension version: v2.14.1

Question
persistent storage not working with local debugging.

when i run the skill in the console it works fine. i download the alexa-hosted-skill code, start the debugger with no issues. when i invoke the skill with an intent that tries to read from the s3 storage i get the following error:


when i try an intent that uses dynamodb, i get this error:
~~~ Error handled: AskSdk.DynamoDbPersistenceAdapter Error: Could not read item (amzn1.ask.account......) from table (undefined): Missing required key 'TableName' in params

is this expected behavior that we would not be able to locally debug skills that use any persistent storage?

these look like things set in env variables for lambda, so perhaps i am missing a setting somewhere???
@tydonelson
Copy link
Contributor

Thanks for reporting @voco-dev ! We'll take a look into how this could be supported.

To make sure we're getting as close to your use case as possible, do you have a snippet (with any sensitive info redacted) from your lambda that illustrates how you're reading from s3 storage?

@voco-dev
Copy link
Author

I was pretty much following the documentation. My code just retrieves the file from s3 using axios

...
const fileUrl = this.getS3PreSignedUrl("Media/menu-data.json");
try {
const res = await Axios.get(fileUrl);
...

the example code from hello world util.js:

const s3SigV4Client = new AWS.S3({
signatureVersion: 'v4',
region: process.env.S3_PERSISTENCE_REGION
});

module.exports.getS3PreSignedUrl = function getS3PreSignedUrl(s3ObjectKey) {

const bucketName = process.env.S3_PERSISTENCE_BUCKET;
const s3PreSignedUrl = s3SigV4Client.getSignedUrl('getObject', {
    Bucket: bucketName,
    Key: s3ObjectKey,
    Expires: 60*1 // the Expires is capped for 1 minute
});
console.log(`Util.s3PreSignedUrl: ${s3ObjectKey} URL ${s3PreSignedUrl}`);
return s3PreSignedUrl;

}

error is:

@tydonelson
Copy link
Contributor

Thanks for the additional info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants