"[Errno 22] Недопустимый аргумент" при запуске "aws таблицы описания DynamodB" на локальной DynamoDB на Windows - PullRequest
1 голос
/ 19 февраля 2020

Я использую тривиальную локальную DynamoDB на Windows:

java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb

aws dynamo list-tables отлично работает:

C:\WINDOWS\system32>aws dynamodb list-tables --endpoint-url http://localhost:8000
{
    "TableNames": [
        "MusicCollection2"
    ]
}

Однако пытаюсь описать существующая таблица MusicCollection2 терпит неудачу:

C:\WINDOWS\system32>aws dynamodb describe-table --table-name MusicCollection2 --endpoint-url http://localhost:8000

[Errno 22] Invalid argument

Согласно ответу здесь - Опишите таблицу Dynamodb при локальной установке, используя URL-адрес конечной точки? -, используя --endpoint-url для операции describe-table все в порядке (см. также пункт в документации здесь ).

Примечательно, что выполнение одной и той же команды для несуществующей таблицы, похоже, работает правильно:

C:\WINDOWS\system32>aws dynamodb describe-table --table-name thisTableDoesNotExist --endpoint-url http://localhost:8000

An error occurred (ResourceNotFoundException) when calling the DescribeTable operation: Cannot do operations on a non-existent table

Так что на самом деле выглядит, что это какая-то ошибка Python. Я пытался обновить pip и awscli, но ничего не помогает. Вероятно, это ошибка внутри aws-cli кода.

Есть идеи? Заранее спасибо за любой ответ.

ОБНОВЛЕНИЕ: Вот исполнение с опцией --debug, благодаря совету @ AndrewA. В журналах мы видим, что ответ для таблицы подготовлен, но потом что-то не получается.

C:\WINDOWS\system32>aws dynamodb describe-table --table-name MusicCollection2 --endpoint-url http://localhost:8000 --debug
2020-02-19 16:27:36,657 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.0.0dev5 Python/3.7.5 Windows/10 botocore/2.0.0dev4
2020-02-19 16:27:36,657 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['dynamodb', 'describe-table', '--table-name', 'MusicCollection2', '--endpoint-url', 'http://localhost:8000', '--debug']
2020-02-19 16:27:36,658 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_timestamp_parser at 0x000001D7685CB4C8>
2020-02-19 16:27:36,658 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x000001D7675B5AF8>
2020-02-19 16:27:36,658 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_binary_formatter at 0x000001D768617318>
2020-02-19 16:27:36,658 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x000001D7675E58B8>
2020-02-19 16:27:36,660 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x000001D767C84D38>
2020-02-19 16:27:36,660 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_json_file_cache at 0x000001D767C2D828>
2020-02-19 16:27:36,697 - MainThread - botocore.loaders - DEBUG - Loading JSON file: C:\Program Files\Amazon\AWSCLIV2DevPreview\botocore\data\dynamodb\2012-08-10\service-2.json
2020-02-19 16:27:36,702 - MainThread - botocore.hooks - DEBUG - Event building-command-table.dynamodb: calling handler <function _add_wizard_command at 0x000001D76860ECA8>
2020-02-19 16:27:36,703 - MainThread - botocore.hooks - DEBUG - Event building-command-table.dynamodb: calling handler <function add_waiters at 0x000001D7685DB0D8>
2020-02-19 16:27:36,733 - MainThread - botocore.loaders - DEBUG - Loading JSON file: C:\Program Files\Amazon\AWSCLIV2DevPreview\botocore\data\dynamodb\2012-08-10\waiters-2.json
2020-02-19 16:27:36,733 - MainThread - awscli.clidriver - DEBUG - OrderedDict([('table-name', <awscli.arguments.CLIArgument object at 0x000001D7687C5248>)])
2020-02-19 16:27:36,734 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.dynamodb.describe-table: calling handler <function add_streaming_output_arg at 0x000001D7685CF798>
2020-02-19 16:27:36,734 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.dynamodb.describe-table: calling handler <function add_cli_input_json at 0x000001D7675E7F78>
2020-02-19 16:27:36,734 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.dynamodb.describe-table: calling handler <function add_cli_input_yaml at 0x000001D7675EBAF8>
2020-02-19 16:27:36,734 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.dynamodb.describe-table: calling handler <function unify_paging_params at 0x000001D767C46A68>
2020-02-19 16:27:36,771 - MainThread - botocore.loaders - DEBUG - Loading JSON file: C:\Program Files\Amazon\AWSCLIV2DevPreview\botocore\data\dynamodb\2012-08-10\paginators-1.json
2020-02-19 16:27:36,771 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.dynamodb.describe-table: calling handler <function add_generate_skeleton at 0x000001D767D31A68>
2020-02-19 16:27:36,772 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.dynamodb.describe-table: calling handler <function add_auto_prompt at 0x000001D768614438>
2020-02-19 16:27:36,772 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.dynamodb.describe-table: calling handler <bound method OverrideRequiredArgsArgument.override_required_args of <awscli.customizations.cliinput.CliInputJSONArgument object at 0x000001D7687C5288>>
2020-02-19 16:27:36,772 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.dynamodb.describe-table: calling handler <bound method OverrideRequiredArgsArgument.override_required_args of <awscli.customizations.cliinput.CliInputYAMLArgument object at 0x000001D7687C52C8>>
2020-02-19 16:27:36,772 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.dynamodb.describe-table: calling handler <bound method GenerateCliSkeletonArgument.override_required_args of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x000001D7687C8D48>>
2020-02-19 16:27:36,773 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.dynamodb.describe-table: calling handler <bound method AutoPromptArgument.override_required_args of <awscli.customizations.autoprompt.AutoPromptArgument object at 0x000001D7687D3DC8>>
2020-02-19 16:27:36,773 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.describe-table.table-name: calling handler <awscli.paramfile.URIArgumentHandler object at 0x000001D76736F3C8>
2020-02-19 16:27:36,773 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.dynamodb.describe-table: calling handler <awscli.argprocess.ParamShorthandParser object at 0x000001D767390148>
2020-02-19 16:27:36,774 - MainThread - awscli.arguments - DEBUG - Unpacked value of 'MusicCollection2' for parameter "table_name": 'MusicCollection2'
2020-02-19 16:27:36,774 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.describe-table.cli-input-json: calling handler <awscli.paramfile.URIArgumentHandler object at 0x000001D76736F3C8>
2020-02-19 16:27:36,774 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.describe-table.cli-input-yaml: calling handler <awscli.paramfile.URIArgumentHandler object at 0x000001D76736F3C8>
2020-02-19 16:27:36,774 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.describe-table.generate-cli-skeleton: calling handler <awscli.paramfile.URIArgumentHandler object at 0x000001D76736F3C8>
2020-02-19 16:27:36,774 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.dynamodb.describe-table.cli-auto-prompt: calling handler <awscli.paramfile.URIArgumentHandler object at 0x000001D76736F3C8>
2020-02-19 16:27:36,775 - MainThread - botocore.hooks - DEBUG - Event calling-command.dynamodb.describe-table: calling handler <bound method CliInputArgument.add_to_call_parameters of <awscli.customizations.cliinput.CliInputJSONArgument object at 0x000001D7687C5288>>
2020-02-19 16:27:36,775 - MainThread - botocore.hooks - DEBUG - Event calling-command.dynamodb.describe-table: calling handler <bound method CliInputArgument.add_to_call_parameters of <awscli.customizations.cliinput.CliInputYAMLArgument object at 0x000001D7687C52C8>>
2020-02-19 16:27:36,775 - MainThread - botocore.hooks - DEBUG - Event calling-command.dynamodb.describe-table: calling handler <bound method GenerateCliSkeletonArgument.generate_skeleton of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x000001D7687C8D48>>
2020-02-19 16:27:36,775 - MainThread - botocore.hooks - DEBUG - Event calling-command.dynamodb.describe-table: calling handler <bound method AutoPromptArgument.auto_prompt_arguments of <awscli.customizations.autoprompt.AutoPromptArgument object at 0x000001D7687D3DC8>>
2020-02-19 16:27:36,775 - MainThread - botocore.hooks - DEBUG - Event calling-command.dynamodb.describe-table: calling handler <bound method DynamoDBPaginatorFix._maybe_register_pagination_fix of <awscli.customizations.dynamodb.paginatorfix.DynamoDBPaginatorFix object at 0x000001D768662408>>
2020-02-19 16:27:36,775 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env
2020-02-19 16:27:36,776 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role
2020-02-19 16:27:36,776 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role-with-web-identity
2020-02-19 16:27:36,776 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: sso
2020-02-19 16:27:36,776 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file
2020-02-19 16:27:36,777 - MainThread - botocore.credentials - INFO - Found credentials in shared credentials file: ~/.aws/credentials
2020-02-19 16:27:36,778 - MainThread - botocore.loaders - DEBUG - Loading JSON file: C:\Program Files\Amazon\AWSCLIV2DevPreview\botocore\data\endpoints.json
2020-02-19 16:27:36,781 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x000001D7671F1678>
2020-02-19 16:27:36,785 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.dynamodb: calling handler <function add_generate_presigned_url at 0x000001D7671A99D8>
2020-02-19 16:27:36,789 - MainThread - botocore.endpoint - DEBUG - Setting dynamodb timeout as (60, 60)
2020-02-19 16:27:36,790 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.dynamodb.DescribeTable: calling handler <function base64_decode_input_blobs at 0x000001D7686173A8>
2020-02-19 16:27:36,790 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.dynamodb.DescribeTable: calling handler <function generate_idempotent_uuid at 0x000001D7671F7318>
2020-02-19 16:27:36,792 - MainThread - botocore.hooks - DEBUG - Event before-call.dynamodb.DescribeTable: calling handler <function inject_api_version_header_if_needed at 0x000001D7671F3DC8>
2020-02-19 16:27:36,792 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=DescribeTable) with params: {'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'X-Amz-Target': 'DynamoDB_20120810.DescribeTable', 'Content-Type': 'application/x-amz-json-1.0', 'User-Agent': 'aws-cli/2.0.0dev5 Python/3.7.5 Windows/10 botocore/2.0.0dev4'}, 'body': b'{"TableName": "MusicCollection2"}', 'url': 'http://localhost:8000/', 'context': {'client_region': 'eu-central-1', 'client_config': <botocore.config.Config object at 0x000001D7689B4AC8>, 'has_streaming_input': False, 'auth_type': None}}
2020-02-19 16:27:36,794 - MainThread - botocore.hooks - DEBUG - Event request-created.dynamodb.DescribeTable: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x000001D768963C88>>
2020-02-19 16:27:36,800 - MainThread - botocore.hooks - DEBUG - Event choose-signer.dynamodb.DescribeTable: calling handler <function set_operation_specific_signer at 0x000001D7671EA3A8>
2020-02-19 16:27:36,800 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2020-02-19 16:27:36,801 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
POST
/

content-type:application/x-amz-json-1.0
host:localhost:8000
x-amz-date:20200219T152736Z
x-amz-target:DynamoDB_20120810.DescribeTable

content-type;host;x-amz-date;x-amz-target
5d0e6d0e46a31a31142cf5855d833cddb3fef13b4c3d5700046f25a7c056b82a
2020-02-19 16:27:36,805 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20200219T152736Z
20200219/eu-central-1/dynamodb/aws4_request
af8750548b678a85ed3555c67831051b718bf7fdc3b7ef6ddf4e4695cd993901
2020-02-19 16:27:36,805 - MainThread - botocore.auth - DEBUG - Signature:
1c7b401771ff3a4546223c681a8606e6713c97319516e8b76cc3dca585c40819
2020-02-19 16:27:36,811 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=http://localhost:8000/, headers={'X-Amz-Target': b'DynamoDB_20120810.DescribeTable', 'Content-Type': b'application/x-amz-json-1.0', 'User-Agent': b'aws-cli/2.0.0dev5 Python/3.7.5 Windows/10 botocore/2.0.0dev4', 'X-Amz-Date': b'20200219T152736Z', 'Authorization': b'AWS4-HMAC-SHA256 Credential=AKIA2JQP2GIRPZIAEN6R/20200219/eu-central-1/dynamodb/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=1c7b401771ff3a4546223c681a8606e6713c97319516e8b76cc3dca585c40819', 'Content-Length': '33'}>
2020-02-19 16:27:36,812 - MainThread - urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): localhost:8000
2020-02-19 16:27:36,824 - MainThread - urllib3.connectionpool - DEBUG - http://localhost:8000 "POST / HTTP/1.1" 200 684
2020-02-19 16:27:36,825 - MainThread - botocore.parsers - DEBUG - Response headers: {'Content-Type': 'application/x-amz-json-1.0', 'x-amz-crc32': '2872083441', 'x-amzn-RequestId': '998594aa-4ce2-495b-9293-22b264a000ef', 'Content-Length': '684', 'Server': 'Jetty(8.1.12.v20130726)'}
2020-02-19 16:27:36,827 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"Table":{"AttributeDefinitions":[{"AttributeName":"Artist","AttributeType":"S"},{"AttributeName":"SongTitle","AttributeType":"S"}],"TableName":"MusicCollection2","KeySchema":[{"AttributeName":"Artist","KeyType":"HASH"},{"AttributeName":"SongTitle","KeyType":"RANGE"}],"TableStatus":"ACTIVE","CreationDateTime":1582112344.614,"ProvisionedThroughput":{"LastIncreaseDateTime":0.000,"LastDecreaseDateTime":0.000,"NumberOfDecreasesToday":0,"ReadCapacityUnits":5,"WriteCapacityUnits":5},"TableSizeBytes":0,"ItemCount":0,"TableArn":"arn:aws:dynamodb:ddblocal:000000000000:table/MusicCollection2","BillingModeSummary":{"BillingMode":"PROVISIONED","LastUpdateToPayPerRequestDateTime":0.000}}}'
2020-02-19 16:27:36,833 - MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
  File "site-packages\awscli\clidriver.py", line 331, in main
  File "site-packages\awscli\clidriver.py", line 503, in __call__
  File "site-packages\awscli\clidriver.py", line 681, in __call__
  File "site-packages\awscli\clidriver.py", line 802, in invoke
  File "site-packages\awscli\clidriver.py", line 814, in _make_client_call
  File "site-packages\botocore\client.py", line 201, in _api_call
  File "site-packages\botocore\client.py", line 498, in _make_api_call
  File "site-packages\botocore\client.py", line 517, in _make_request
  File "site-packages\botocore\endpoint.py", line 102, in make_request
  File "site-packages\botocore\endpoint.py", line 135, in _send_request
  File "site-packages\botocore\endpoint.py", line 167, in _get_response
  File "site-packages\botocore\endpoint.py", line 218, in _do_get_response
  File "site-packages\botocore\parsers.py", line 242, in parse
  File "site-packages\botocore\parsers.py", line 740, in _do_parse
  File "site-packages\botocore\parsers.py", line 761, in _handle_json_body
  File "site-packages\botocore\parsers.py", line 302, in _parse_shape
  File "site-packages\botocore\parsers.py", line 572, in _handle_structure
  File "site-packages\botocore\parsers.py", line 302, in _parse_shape
  File "site-packages\botocore\parsers.py", line 572, in _handle_structure
  File "site-packages\botocore\parsers.py", line 302, in _parse_shape
  File "site-packages\botocore\parsers.py", line 572, in _handle_structure
  File "site-packages\botocore\parsers.py", line 302, in _parse_shape
  File "site-packages\botocore\parsers.py", line 589, in _handle_timestamp
  File "site-packages\awscli\customizations\timestampformat.py", line 44, in iso_format
  File "site-packages\botocore\utils.py", line 530, in parse_timestamp
  File "site-packages\dateutil\tz\_common.py", line 144, in fromutc
  File "site-packages\dateutil\tz\_common.py", line 258, in fromutc
  File "site-packages\dateutil\tz\_common.py", line 222, in _fromutc
  File "site-packages\dateutil\tz\tz.py", line 222, in utcoffset
  File "site-packages\dateutil\tz\tz.py", line 291, in _isdst
  File "site-packages\dateutil\tz\tz.py", line 260, in _naive_is_dst
OSError: [Errno 22] Invalid argument
2020-02-19 16:27:36,834 - MainThread - awscli.clidriver - DEBUG - Exiting with rc 255

[Errno 22] Invalid argument
...