jovotech / jovo-framework

🔈 The React for Voice and Chat: Build Apps for Alexa, Messenger, Instagram, the Web, and more
https://www.jovo.tech
Apache License 2.0
1.68k stars 309 forks source link

Error using newly created DynamoDB tables #36

Closed funkymonkeymonk closed 6 years ago

funkymonkeymonk commented 6 years ago

I'm getting an error working with a newly created dynamoDB.

2017-11-02 18:18:03.604 (+00:00)    2a8333a9-bffa-11e7-a1e5-51dac69da33d    TypeError: Cannot read property 'userData' of null
    at /var/task/node_modules/jovo-framework/lib/jovo.js:226:37
    at DynamoDb.checkResourceNotFound (/var/task/node_modules/jovo-framework/lib/integrations/db/dynamoDb.js:328:13)
    at Response.<anonymous> (/var/task/node_modules/jovo-framework/lib/integrations/db/dynamoDb.js:209:22)
    at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:364:18)
    at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10

I've been trying to dig into this a bit to figure out what is happening and I'm not sure. When I run the same code locally using a webhook and local file store it's running fine. Please let me know what type of diagnostics I can do to troubleshoot the issue.

Edited to fix styling

jankoenig commented 6 years ago

Hi @funkymonkeymonk, thanks! So this didn't happen before with a previous table, or is it the first time you're using the DynamoDB integration?

funkymonkeymonk commented 6 years ago

This happens on a brand new table. I had a previous working table, which this started to fail on and as a diagnostic step I tried deleting the table and letting the framework recreate it. It performs the recreate on the first invocation though fails due to a race condition between table creation and table access, then fails the same way on the second invocation.

jankoenig commented 6 years ago

Thanks for the further explanation. We will investigate and fix as soon as possible. cc @aswetlow

jankoenig commented 6 years ago

Hi @funkymonkeymonk, still trying to reproduce this. Can you tell us which version of the framework you're using?

aswetlow commented 6 years ago

Hey @funkymonkeymonk, could you please log the error object in checkResourceNotFound(error, callback) in /node_modules/jovo-framework/lib/integrations/db/dynamoDb.js (Line 326)

I think it's an aws-error that is not handled by the framework.

funkymonkeymonk commented 6 years ago

For sure. I'll try to do it tonight when I get home from work.

jankoenig commented 6 years ago

Hi @funkymonkeymonk, any news on this issue?

funkymonkeymonk commented 6 years ago

Hey. I haven't been able to get time to check it out but I will be over the weekend.

On Fri, Nov 10, 2017, 2:29 AM Jan König notifications@github.com wrote:

Hi @funkymonkeymonk https://github.com/funkymonkeymonk, any news on this issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jovotech/jovo-framework-nodejs/issues/36#issuecomment-343395653, or mute the thread https://github.com/notifications/unsubscribe-auth/AFHumeMJtC5iseK5YmG12SRA1BpKrtz8ks5s0_tzgaJpZM4QQJDv .

jankoenig commented 6 years ago

Sounds good, thanks! Have a great weekend

funkymonkeymonk commented 6 years ago

@aswetlow @jankoenig I believe this is the object you're requesting.

{ ValidationException: The provided key element does not match the schema at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:48:27) at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:105:20) at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:77:10) at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:683:14) at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10) at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12) at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10 at Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9) at Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:685:12) at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:115:18) message: 'The provided key element does not match the schema', code: 'ValidationException', time: 2017-11-12T18:28:17.865Z, requestId: 'REQUEST_ID_REMOVED', statusCode: 400, retryable: false, retryDelay: 16.131448494598168 }

jankoenig commented 6 years ago

Hi @funkymonkeymonk, thanks, can you please delete the table again and let the voice app create a new one (not manually, will be done by running the app) and send the logs again?

jankoenig commented 6 years ago

Closing this for now