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

configureSample.sh fails with Cannot read property 'describeKey' of undefined #28

Closed
jstoor opened this issue Jun 30, 2015 · 1 comment

Comments

@jstoor
Copy link

jstoor commented Jun 30, 2015

We're attempting to run the sample loader.

We have a bucket in S3, DynamoDB has the three tables created with setup.js
and we have a Redshift DB.

Aware that have to be in the same region.

When executing the script "configureSample.sh", get the following error:
Note had to use a tunnel to our cluster endpoint.

/Users/xxxx/xxxx/aws-lambda-redshift-loader/kmsCrypto.js:55
        kms.describeKey({
           ^
TypeError: Cannot read property 'describeKey' of undefined
    at getOrCreateMasterKey (/Users/xxxx/xxxx/aws-lambda-redshift-loader/kmsCrypto.js:55:5)
    at Object.encrypt (/Users/xxxx/xxxx/aws-lambda-redshift-loader/kmsCrypto.js:116:2)
    at Object.<anonymous> (/Users/xxxx/xxxxx/aws-lambda-redshift-loader/sample/scripts/createSampleConfig.js:51:11)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

https://github.com/awslabs/aws-lambda-redshift-loader/blob/master/kmsCrypto.js#L44

Appears to not be working and the function is not called, hence kms is not initialised.

We hacked the code to explicitly initialise kms, but that only got us so far:

Configuration for dp-transform-test-01/input successfully written in us-east-1
/Users/xxxxx/xxxxxx/aws-lambda-redshift-loader/node_modules/aws-sdk/lib/request.js:32
          throw err;
                ^
TypeError: undefined is not a function
    at Response.<anonymous> (/Users/xxxxx/xxxxxx/aws-lambda-redshift-loader/common.js:228:6)
    at Request.<anonymous> (/Users/xxxxx/xxxxxx/aws-lambda-redshift-loader/node_modules/aws-sdk/lib/request.js:350:18)
    at Request.callListeners (/Users/xxxxx/xxxxxx/aws-lambda-redshift-loader/node_modules/aws-sdk/lib/sequential_executor.js:100:18)
    at Request.emit (/Users/xxxxx/xxxxxx/aws-lambda-redshift-loader/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/Users/xxxxx/xxxxxx/aws-lambda-redshift-loader/node_modules/aws-sdk/lib/request.js:592:14)
    at Request.transition (/Users/xxxxx/xxxxxx/aws-lambda-redshift-loader/node_modules/aws-sdk/lib/request.js:21:12)
    at AcceptorStateMachine.runTo (/Users/xxxxx/xxxxxx/aws-lambda-redshift-loader/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/xxxxx/xxxxxx/aws-lambda-redshift-loader/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/xxxxx/xxxxxx/aws-lambda-redshift-loader/node_modules/aws-sdk/lib/request.js:22:9)
    at Request.<anonymous> (/Users/xxxxx/xxxxxx/aws-lambda-redshift-loader/node_modules/aws-sdk/lib/request.js:594:12)

Any help or advice would be greatly appreciated.

Thank You

@IanMeyers
Copy link
Contributor

Sorry about this - we changed the interface for how regions were set on the Key Management Service, and introduced this bug. Now fixed with a patch to createSampleConfig.js.

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

2 participants