Closed gconcepts closed 4 years ago
Thank you for reporting this issue.
I was able to reproduce your error, the problem was that the program wasn't converting the data to the right type of data, in other words, the same type defined for the keys in the DynamoDB table.
I've just released a new version, could you test if it is working? It is the version 0.1.5.
Thanks. Will try that out now and report back.
I still seem to be getting the same error and I even uninstalled the older version and installed the new one.
What you see when you run gem list dynamocli
?
gem list dynamocli
LOCAL GEMS
dynamocli (0.1.5)
That's weird, could you paste the error again?
dynamocli import APIReleases.csv --table ethos-affinity-api-releases
/Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.62.0/lib/seahorse/client/plugins/raise_response_errors.rb:15:in call': The provided key element does not match the schema (Aws::DynamoDB::Errors::ValidationException) from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-dynamodb-1.34.0/lib/aws-sdk-dynamodb/plugins/simple_attributes.rb:117:in
call'
from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.62.0/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:in call' from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.62.0/lib/aws-sdk-core/plugins/idempotency_token.rb:17:in
call'
from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.62.0/lib/aws-sdk-core/plugins/param_converter.rb:24:in call' from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.62.0/lib/aws-sdk-core/plugins/response_paging.rb:10:in
call'
from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.62.0/lib/seahorse/client/plugins/response_target.rb:23:in call' from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.62.0/lib/seahorse/client/request.rb:70:in
send_request'
from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-dynamodb-1.34.0/lib/aws-sdk-dynamodb/client.rb:823:in batch_write_item' from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.5/lib/dynamocli/import.rb:59:in
block in write_records_to_dynamodb_table'
from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.5/lib/dynamocli/import.rb:58:in each' from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.5/lib/dynamocli/import.rb:58:in
each_slice'
from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.5/lib/dynamocli/import.rb:58:in each' from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.5/lib/dynamocli/import.rb:58:in
write_records_to_dynamodb_table'
from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.5/lib/dynamocli/import.rb:19:in start' from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.5/lib/dynamocli.rb:17:in
import'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.3/lib/thor/command.rb:27:in run' from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in
invoke_command'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.3/lib/thor.rb:387:in dispatch' from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.3/lib/thor/base.rb:466:in
start'
from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.5/bin/dynamocli:6:in <top (required)>' from /usr/local/bin/dynamocli:22:in
load'
from /usr/local/bin/dynamocli:22:in `
Does your table have some index?
Yes it does have an index. I will try deleting the index and try it out again.
Same error with the index deleted. Will wait a bit in case AWS index deletion is still synching
Same error. Does it work for you?
Yes, it does :cry:.
Weird. Let me delete the table and recreate without the index and i'll see if it works
Same error still. Can you send me a screenshot of your table overview page?
Here it is:
This is baffling. Still getting the same error after recreating the table. Are you on a Mac?
No, I'm running Linux.
Maybe Ruby is not running the right version, you can try cloning the repository and execute in the repository folder ./bin/dynamocli import APIReleases.csv --to ethos-affinity-api-releases
Ok. Will try that out and keep you posted
Same error. I will try it out from a linux VM and see if the same error occurs. Will keep you updated.
Same error on a Linux based distro.
It doesn't make much sense but maybe can be your credentials, what permissions your machine have on AWS?
The same account has full admin permission in AWS. I can use the same account to perform the tasks manually within AWS console
Hey guys, I have a same issue, already checked permissions and creds. Any solution? (I'm also working on Mac)
Hi, could you post the error here too?
Antons-MacBook-Pro:iosbaliblogger admin$ dynamocli import aeguides-baliblogger-main.csv --to aeguides-baliblogger-main
Traceback (most recent call last):
22: from /usr/local/bin/dynamocli:23:in <main>' 21: from /usr/local/bin/dynamocli:23:in
load'
20: from /Library/Ruby/Gems/2.6.0/gems/dynamocli-0.1.5/bin/dynamocli:6:in <top (required)>' 19: from /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in
start'
18: from /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in dispatch' 17: from /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in
invoke_command'
16: from /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in run' 15: from /Library/Ruby/Gems/2.6.0/gems/dynamocli-0.1.5/lib/dynamocli.rb:17:in
import'
14: from /Library/Ruby/Gems/2.6.0/gems/dynamocli-0.1.5/lib/dynamocli/import.rb:19:in start' 13: from /Library/Ruby/Gems/2.6.0/gems/dynamocli-0.1.5/lib/dynamocli/import.rb:58:in
write_records_to_dynamodb_table'
12: from /Library/Ruby/Gems/2.6.0/gems/dynamocli-0.1.5/lib/dynamocli/import.rb:58:in each' 11: from /Library/Ruby/Gems/2.6.0/gems/dynamocli-0.1.5/lib/dynamocli/import.rb:58:in
each_slice'
10: from /Library/Ruby/Gems/2.6.0/gems/dynamocli-0.1.5/lib/dynamocli/import.rb:58:in each' 9: from /Library/Ruby/Gems/2.6.0/gems/dynamocli-0.1.5/lib/dynamocli/import.rb:59:in
block in write_records_to_dynamodb_table'
8: from /Library/Ruby/Gems/2.6.0/gems/aws-sdk-dynamodb-1.38.0/lib/aws-sdk-dynamodb/client.rb:816:in batch_write_item' 7: from /Library/Ruby/Gems/2.6.0/gems/aws-sdk-core-3.77.0/lib/seahorse/client/request.rb:70:in
send_request'
6: from /Library/Ruby/Gems/2.6.0/gems/aws-sdk-core-3.77.0/lib/seahorse/client/plugins/response_target.rb:23:in call' 5: from /Library/Ruby/Gems/2.6.0/gems/aws-sdk-core-3.77.0/lib/aws-sdk-core/plugins/response_paging.rb:10:in
call'
4: from /Library/Ruby/Gems/2.6.0/gems/aws-sdk-core-3.77.0/lib/aws-sdk-core/plugins/param_converter.rb:24:in call' 3: from /Library/Ruby/Gems/2.6.0/gems/aws-sdk-core-3.77.0/lib/aws-sdk-core/plugins/idempotency_token.rb:17:in
call'
2: from /Library/Ruby/Gems/2.6.0/gems/aws-sdk-core-3.77.0/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:in call' 1: from /Library/Ruby/Gems/2.6.0/gems/aws-sdk-dynamodb-1.38.0/lib/aws-sdk-dynamodb/plugins/simple_attributes.rb:117:in
call'
/Library/Ruby/Gems/2.6.0/gems/aws-sdk-core-3.77.0/lib/seahorse/client/plugins/raise_response_errors.rb:15:in `call': The provided key element does not match the schema (Aws::DynamoDB::Errors::ValidationException)
Antons-MacBook-Pro:iosbaliblogger admin$
Just for testing I:
Really like ur tool, hope you will be able to fix this issue=)
Hi, thanks for the feedback.
I've followed the steps you provided and now I know why it's crashing.
That is the header from the CSV exported from AWS Web Console:
"id (N)","name (S)","age (N)","source (S)","tree (S)"
dynamocli
expects the exact name of the field and here we have id (N)
instead of id
.
I suggest you edit the header of the CSV file by now because I don't know if it is a good idea to remove the (N)
part on my tool. I'll think about it and let you know if I implement it. You can give suggestions if you want :smile:.
Heey Matheus! Thanks for reply, now works like a charm 🎉
Well, you know it might be no need to add support of "id (S)" style header, but it might be useful if you put a chapter in Readme.md with an example of correct header and csv file format.
Still, it is a case that lots of people will try to use Export csv feature from AWS console and after look for solution to import it. To change header line in csv by hands is not a problem at all, but it's nice to know that you have to do it =))
Adjusting the headers worked! Nice work, Update your usage instructions to consider this scenario. I think is the most frequent!
I've made a new release. Now, it is possible to call dynamocli import
passing the option --exported-from-aws
. This will modify the header. I hope you enjoy. :smile:.
Closing this issue.
I'm getting the below exception when trying to push data from a CSV to a dynamodb table
{code} USD1601311:DataGenerator ooshiber$ dynamocli import APIReleases.csv --table ethos-affinity-api-releases /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.62.0/lib/seahorse/client/plugins/raise_response_errors.rb:15:in'
{code}
call': The provided key element does not match the schema (Aws::DynamoDB::Errors::ValidationException) from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-dynamodb-1.34.0/lib/aws-sdk-dynamodb/plugins/simple_attributes.rb:117:in
call' from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.62.0/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:incall' from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.62.0/lib/aws-sdk-core/plugins/idempotency_token.rb:17:in
call' from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.62.0/lib/aws-sdk-core/plugins/param_converter.rb:24:incall' from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.62.0/lib/aws-sdk-core/plugins/response_paging.rb:10:in
call' from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.62.0/lib/seahorse/client/plugins/response_target.rb:23:incall' from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-core-3.62.0/lib/seahorse/client/request.rb:70:in
send_request' from /Library/Ruby/Gems/2.3.0/gems/aws-sdk-dynamodb-1.34.0/lib/aws-sdk-dynamodb/client.rb:823:inbatch_write_item' from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.4/lib/dynamocli/import.rb:45:in
block in write_records_to_dynamodb_table' from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.4/lib/dynamocli/import.rb:44:ineach' from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.4/lib/dynamocli/import.rb:44:in
each_slice' from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.4/lib/dynamocli/import.rb:44:ineach' from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.4/lib/dynamocli/import.rb:44:in
write_records_to_dynamodb_table' from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.4/lib/dynamocli/import.rb:18:instart' from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.4/lib/dynamocli.rb:17:in
import' from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.3/lib/thor/command.rb:27:inrun' from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in
invoke_command' from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.3/lib/thor.rb:387:indispatch' from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.3/lib/thor/base.rb:466:in
start' from /Library/Ruby/Gems/2.3.0/gems/dynamocli-0.1.4/bin/dynamocli:6:in<top (required)>' from /usr/local/bin/dynamocli:22:in
load' from /usr/local/bin/dynamocli:22:in `My dynamodb table looks as below {code} {code}
The data in the CSV looks like below {code} releaseId,releaseName,releaseVersion 1,Test,1.17.0 2,Test,1.18.0 3,Test,1.19.0 4,Test,1.20.0 5,Test,1.21.0 {code}
What do you think could be the issue?