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

Allow arbitrary table names #8

Open
eleiva opened this issue May 7, 2015 · 4 comments
Open

Allow arbitrary table names #8

eleiva opened this issue May 7, 2015 · 4 comments
Labels

Comments

@eleiva
Copy link

eleiva commented May 7, 2015

Cannot connect with dynamoDB
Seems that is an error in my config ( related to the region ) but i double check and is all fine.

I tried with this in the model :

module.exports = {
  identity : "Sample",
  tableName: 'Sample',
  attributes: {
  }
};

And with "sample" table name in lowercase without luck.
Error Log:

error: Sending 500 ("Server Error") response: 
 Error (E_UNKNOWN) :: Encountered an unexpected error
ResourceNotFoundException: Requested resource not found
    at Request.extractError (/var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/protocol/json.js:43:27)
    at Request.callListeners (/var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/sequential_executor.js:100:18)
    at Request.emit (/var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/request.js:604:14)
    at Request.transition (/var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/request.js:21:12)
    at AcceptorStateMachine.runTo (/var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/request.js:22:9)
    at Request.<anonymous> (/var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/request.js:606:12)
    at Request.callListeners (/var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/sequential_executor.js:104:18)
    at Request.emit (/var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/request.js:604:14)
    at Request.transition (/var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/request.js:21:12)
    at AcceptorStateMachine.runTo (/var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/var/www/html/www/projects2015/krakatoa/krakatoa-api/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/request.js:22:9)

Thanks in advance.

@devinivy
Copy link
Collaborator

devinivy commented May 8, 2015

That typically means that it can't find the table that's being referenced. There is an odd default behavior of Vogels, which is what this adapter is based-upon, which requires that the table name be pluralized and lower-cased on amazon. I'll certainly accept a PR to fix this bug! See the Vogels docs: https://github.com/ryanfitz/vogels

After you've defined your model you can configure the table name to use. By default, the table name used will be the lowercased and pluralized version of the name you provided when defining the model.

@devinivy devinivy added the bug label May 8, 2015
@devinivy devinivy mentioned this issue May 9, 2015
@micahschaefer
Copy link

Yes that is working now. I read "pluralize" as uppercase. So creating a table in DynamoDB all lowercase in a plural form (with an "s" at the end ) now works.

It looks like Vogel either is not receiving or doesn't care about the tableName attribute. I'll look into that. Thanks for the quick response!

@devinivy devinivy changed the title Details: ResourceNotFoundException: Requested resource not found Allow arbitrary table names Oct 14, 2015
@phillip-hall
Copy link

Are there any plans to update to the latest version of vogels?

It seems that the latest version of vogels would fix this issue and #20.

@devinivy
Copy link
Collaborator

@phillip-hall good to know! Would certainly take a PR.

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

No branches or pull requests

4 participants