Note that there are some explanatory texts on larger screens.

plurals
  1. PODynamoDB2 and Boto 2.9.5 bad request on batch query and single item get
    text
    copied!<p>I am having trouble doing any single or batch query with boto 2.9.5 using the DynamoDB2 API</p> <p>I need to do a batch query like this:</p> <pre><code>one_org = Table('[table-name]').batch_get(keys=[ {'key': '[user-id-hash]'}, {'key': '[user-id-hash]'}, {'key': '[user-id-hash]'}, {'key': '[user-id-hash]'}, ]) for user in one_org: for key, value in user.items(): print key, value </code></pre> <p>I keep getting this exception:</p> <pre><code>boto.dynamodb2.exceptions.ValidationException: ValidationException: 400 Bad Request { u'message': u'The provided key element does not match the schema', u'__type': u'com.amazon.coral.validate#ValidationException' } </code></pre> <p>Given this message I'd think there'd be a problem with the name of the key, but our key is called key, so it doesn't make any sense to me.</p> <p>I included the stack trace below:</p> <pre><code>Traceback (most recent call last): File "aws/interfaces.py", line 38, in &lt;module&gt; for user in one_org: File "/home/kasper/Falcon/thenest/venv/local/lib/python2.7/site-packages/boto/dynamodb2/results.py", line 59, in next self.fetch_more() File "/home/kasper/Falcon/thenest/venv/local/lib/python2.7/site-packages/boto/dynamodb2/results.py", line 141, in fetch_more results = self.the_callable(*args, **kwargs) File "/home/kasper/Falcon/thenest/venv/local/lib/python2.7/site-packages/boto/dynamodb2/table.py", line 949, in _batch_get raw_results = self.connection.batch_get_item(request_items=items) File "/home/kasper/Falcon/thenest/venv/local/lib/python2.7/site-packages/boto/dynamodb2/layer1.py", line 152, in batch_get_item body=json.dumps(params)) File "/home/kasper/Falcon/thenest/venv/local/lib/python2.7/site-packages/boto/dynamodb2/layer1.py", line 1479, in make_request retry_handler=self._retry_handler) File "/home/kasper/Falcon/thenest/venv/local/lib/python2.7/site-packages/boto/connection.py", line 852, in _mexe status = retry_handler(response, i, next_sleep) File "/home/kasper/Falcon/thenest/venv/local/lib/python2.7/site-packages/boto/dynamodb2/layer1.py", line 1518, in _retry_handler response.status, response.reason, data) boto.dynamodb2.exceptions.ValidationException: ValidationException: 400 Bad Request {u'message': u'The provided key element does not match the schema', u'__type': u'com.amazon.coral.validate#ValidationException'} </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload