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 DynamoDB doesn't work. #880

Closed
Qard opened this issue Jan 19, 2016 · 14 comments
Closed

Local DynamoDB doesn't work. #880

Qard opened this issue Jan 19, 2016 · 14 comments
Labels
guidance Question that needs advice or information.

Comments

@Qard
Copy link

Qard commented Jan 19, 2016

I'm trying to configure the DynamoDB client to connect to a local dynamodb for dev like this:

var db = new AWS.DynamoDB({
  endpoint: new AWS.Endpoint(url)
});

It throws this config error here:

{code: 'ConfigError', message: 'Missing region in config'});

Setting region doesn't make sense when connecting to local dynamodb, but If I put it in anyway, it then fails on:

{code: 'CredentialsError', message: 'Missing credentials in config'});

@chrisradek
Copy link
Contributor

@Qard
You also need to specify credentials. Since you're working with your local dynamodb, I don't believe your credentials have to be valid, but the SDK needs something otherwise it will continue to display the Missing credentials in config error.

Let me know if that helps or if you need an example!

@Qard
Copy link
Author

Qard commented Jan 20, 2016

Yeah, I figured that much out. It seems broken to me that I'd have to set a bunch of configs that it doesn't actually use to get it to work properly though.

@jeskew
Copy link
Contributor

jeskew commented Jan 20, 2016

@Qard Your credentials are used by DynamoDB local to maintain separate databases for different users. Your credentials won't be checked, but those configuration parameters do serve a purpose.

@Qard
Copy link
Author

Qard commented Jan 20, 2016

@jeskew
Copy link
Contributor

jeskew commented Jan 20, 2016

If you scroll up on the page you've linked to, you'll see documentation on the --sharedDb option. If not set, your database will be saved in a file named {myaccesskeyid}_{region}.db.

I'll let the doc author know that "Regions and distinct AWS accounts are not supported at the client level" is confusingly worded.

@Alex0007
Copy link

Getting same error
UnrecognizedClientException: The security token included in the request is invalid. when trying to create tables in local db

when i provided valid credentials, table created, but on aws service, not local

This functionality become broken on npm 2.2.32 version

@chrisradek

@chrisradek
Copy link
Contributor

@Alex0007
Can you provide a code snippet? Are you updating the endpoint to look at your local database?

@Alex0007
Copy link

@chrisradek
I'm using vogels (vogels.AWS is AWS) and after updating aws-sdk i'm getting error there

import vogels from 'vogels'
import requireDir from 'require-dir'

vogels.AWS.config.update({
  endpoint: process.env.AWS_DYNAMODB_ENDPOINT,
  accessKeyId: process.env.AWS_ACCESS_KEY_ID,
  secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
  region: process.env.AWS_REGION
})

module.exports = async function() { // create tables

  return new Promise(function (resolve, reject) {
    requireDir()

    vogels.createTables((err) => {
      if (err) {
        console.log(`Error creating tables: ${err}`)
        return reject(`Error creating tables: ${err}`)
      }
      resolve()
    })
  })

}

@Alex0007
Copy link

@chrisradek @jeskew
Please, reopen this issue, because the problem really exist

@jeskew
Copy link
Contributor

jeskew commented Feb 15, 2016

@Alex0007 I'm unable to reproduce the behavior you're experiencing. Have you verified that process.env.AWS_DYNAMODB_ENDPOINT is properly set?

@Alex0007
Copy link

@jeskew
it seems that code working again on aws-sdk latest version

@jeskew
Copy link
Contributor

jeskew commented Feb 21, 2016

Glad to hear everything worked out. Let me know if you have any further questions.

@jeskew jeskew closed this as completed Feb 21, 2016
@ilanle
Copy link

ilanle commented Feb 21, 2016

Getting the same error now.
Just npmd the latest release a few minutes ago,
I get this from dynamo
UnrecognizedClientException: The security token included in the request is invalid

@lock
Copy link

lock bot commented Sep 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

6 participants