Error occurred when creating a table

Create issue
Issue #19 new
Keiji Hokamura created an issue

I use ddbmock as regular client-server.

This is error message from the pserve process:

2013-07-03 19:39:36,686 DEBUG [Request logger][Dummy-2] request_id=73 action=CreateTable body={u'KeySchema': [{u'KeyType': u'HASH', u'AttributeName': u'screen_name'}, {u'KeyType': u'RANGE', u'AttributeName': u'access_token'}], 'request_id': '73', u'TableName': u'found2_access_tokens', u'AttributeDefinitions': [{u'AttributeName': u'screen_name', u'AttributeType': u'S'}, {u'AttributeName': u'access_token', u'AttributeType': u'S'}], u'ProvisionedThroughput': {u'WriteCapacityUnits': 1, u'ReadCapacityUnits': 1}}
2013-07-03 19:39:36,687 ERROR [Request logger][Dummy-2] request_id=73 action=CreateTable exception=AttributeError body=("'list' object has no attribute 'iteritems'",)
2013-07-03 19:39:36,687 ERROR [waitress][Dummy-2] Exception when serving /
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/waitress/", line 332, in service
  File "/Library/Python/2.7/site-packages/waitress/", line 174, in service
  File "/Library/Python/2.7/site-packages/waitress/", line 382, in execute
    app_iter =, start_response)
  File "/Library/Python/2.7/site-packages/pyramid/", line 251, in __call__
    response = self.invoke_subrequest(request, use_tweens=True)
  File "/Library/Python/2.7/site-packages/pyramid/", line 227, in invoke_subrequest
    response = handle_request(request)
  File "/Library/Python/2.7/site-packages/pyramid/", line 21, in excview_tween
    response = handler(request)
  File "/Library/Python/2.7/site-packages/pyramid/", line 161, in handle_request
    response = view_callable(context, request)
  File "/Library/Python/2.7/site-packages/pyramid/config/", line 377, in viewresult_to_response
    result = view(context, request)
  File "/Library/Python/2.7/site-packages/pyramid/config/", line 493, in _requestonly_view
    response = view(request)
  File "/Library/Python/2.7/site-packages/ddbmock/router/", line 21, in pyramid_router
    body = router(action, post)
  File "/Library/Python/2.7/site-packages/ddbmock/router/", line 35, in router
    post = dynamodb_api_validate(target, post)
  File "/Library/Python/2.7/site-packages/ddbmock/validators/", line 27, in dynamodb_api_validate
    return validate(post)
  File "/Library/Python/2.7/site-packages/onctuous/", line 49, in __call__
    return self.validate([], self.schema, data)
  File "/Library/Python/2.7/site-packages/onctuous/", line 62, in validate
    return self._validate_dict(path, schema, data)
  File "/Library/Python/2.7/site-packages/onctuous/", line 125, in _validate_dict
    out[new_key] = self.validate(key_path, rule, value)
  File "/Library/Python/2.7/site-packages/onctuous/", line 62, in validate
    return self._validate_dict(path, schema, data)
  File "/Library/Python/2.7/site-packages/onctuous/", line 100, in _validate_dict
    for key, value in data.iteritems():
AttributeError: 'list' object has no attribute 'iteritems'


Comments (1)

  1. Keiji Hokamura reporter

    I think the rule of ddbmock.validators.types.table_key_schema does not match for KeyChema request parameter of DynamoDB's CreateTable API.

    The rule expects a dict parameter, but actually the parameter is a list.

  2. Log in to comment