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

undefined this.batches in restore #74

Open
totano opened this issue Jan 4, 2018 · 0 comments
Open

undefined this.batches in restore #74

totano opened this issue Jan 4, 2018 · 0 comments

Comments

@totano
Copy link

totano commented Jan 4, 2018

when restoring a table the program crashes with this message

WARN: table [<table name>] will be overwritten.
Starting download. 6Kb remaining...
node_modules/aws-sdk/lib/request.js:31
            throw err;
            ^

TypeError: Cannot read property 'length' of undefined
    at DynamoRestore._checkTableReady (node_modules/dynamo-backup-to-s3/lib/dynamo-restore.js:284:28)
    at Request.<anonymous> (node_modules/aws-sdk/lib/request.js:364:18)
    at Request.callListeners (node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (node_modules/aws-sdk/lib/state_machine.js:14:12)
    at node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (node_modules/aws-sdk/lib/request.js:685:12)

looking at the source code it appears to be a synchronization issue between the s3 file download and the restore batch start, which is happening before while the batches array is still undefined

as a workaround, I raised the timeout on dynamo-restore.js line 109 to 5000
setTimeout(dynamodb.describeTable.bind(dynamodb, { TableName: this.options.table }, this._checkTableReady.bind(this)), 1000);

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

No branches or pull requests

1 participant