aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.57k stars 4.13k forks source link

Unsupported resource type: cluster #7875

Closed makotonakai closed 1 year ago

makotonakai commented 1 year ago

Describe the bug

I tried to update the task definition used by my ECS nginx-with-html-service service in my nginx-with-html cluster (btw, nginx-with-html is a docker image that shows an html file via nginx)

I execute the following command

aws ecs update-service --cluster nginx-with-html--service nginx-with-html-service --task-definition nginx-with-html --debug

Expected Behavior

I could successfully update the version of task definition in my service (nginx-with-html)

Current Behavior

I got the following logs

2023-05-04 15:26:05,390 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.11.17 Python/3.11.3 Linux/5.19.0-1024-aws exe/x86_64.ubuntu.22
2023-05-04 15:26:05,390 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['ecs', 'update-service', '--cluster', '"arn:aws:ecs:(region):(account id):cluster/nginx-with-html"', '--service', '"nginx-with-html-service"', '--task-definition', 'nginx-with-html', '--debug']
2023-05-04 15:26:05,410 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_s3 at 0x7f7288997240>
2023-05-04 15:26:05,410 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_ddb at 0x7f72891d84a0>
2023-05-04 15:26:05,410 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.configure.configure.ConfigureCommand'>>
2023-05-04 15:26:05,410 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x7f7289142660>
2023-05-04 15:26:05,410 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x7f7289143ce0>
2023-05-04 15:26:05,411 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function alias_opsworks_cm at 0x7f728899d760>
2023-05-04 15:26:05,411 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_history_commands at 0x7f7288d16e80>
2023-05-04 15:26:05,411 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class 'awscli.customizations.devcommands.CLIDevCommand'>>
2023-05-04 15:26:05,411 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_waiters at 0x7f728899d620>
2023-05-04 15:26:05,411 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method AliasSubCommandInjector.on_building_command_table of <awscli.alias.AliasSubCommandInjector object at 0x7f728834b550>>
2023-05-04 15:26:05,411 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.11.17/dist/awscli/data/cli.json
2023-05-04 15:26:05,414 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_types at 0x7f7288dec900>
2023-05-04 15:26:05,414 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function no_sign_request at 0x7f7288decc20>
2023-05-04 15:26:05,414 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_verify_ssl at 0x7f7288decb80>
2023-05-04 15:26:05,414 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_read_timeout at 0x7f7288decd60>
2023-05-04 15:26:05,414 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_connect_timeout at 0x7f7288deccc0>
2023-05-04 15:26:05,414 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <built-in method update of dict object at 0x7f7288348a40>
2023-05-04 15:26:05,416 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.11.17 Python/3.11.3 Linux/5.19.0-1024-aws exe/x86_64.ubuntu.22 prompt/off
2023-05-04 15:26:05,416 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['ecs', 'update-service', '--cluster', '"arn:aws:ecs:(region):(account id)cluster/nginx-with-html"', '--service', '"nginx-with-html-service"', '--task-definition', 'nginx-with-html', '--debug']
2023-05-04 15:26:05,416 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_timestamp_parser at 0x7f7288997ba0>
2023-05-04 15:26:05,416 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x7f7289907880>
2023-05-04 15:26:05,417 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_binary_formatter at 0x7f7288312ca0>
2023-05-04 15:26:05,417 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function no_pager_handler at 0x7f7289de3ce0>
2023-05-04 15:26:05,417 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x7f72899491c0>
2023-05-04 15:26:05,420 - MainThread - botocore.utils - DEBUG - IMDS ENDPOINT: http://(endpoint)/
2023-05-04 15:26:05,422 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x7f7288d0b740>
2023-05-04 15:26:05,423 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_json_file_cache at 0x7f72891cc720>
2023-05-04 15:26:05,442 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.11.17/dist/awscli/botocore/data/ecs/2014-11-13/service-2.json
2023-05-04 15:26:05,452 - MainThread - botocore.hooks - DEBUG - Event building-command-table.ecs: calling handler <function inject_commands at 0x7f7288dc1120>
2023-05-04 15:26:05,452 - MainThread - botocore.hooks - DEBUG - Event building-command-table.ecs: calling handler <function add_waiters at 0x7f728899d620>
2023-05-04 15:26:05,469 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.11.17/dist/awscli/botocore/data/ecs/2014-11-13/waiters-2.json
2023-05-04 15:26:05,469 - MainThread - botocore.hooks - DEBUG - Event building-command-table.ecs: calling handler <bound method AliasSubCommandInjector.on_building_command_table of <awscli.alias.AliasSubCommandInjector object at 0x7f728834b550>>
2023-05-04 15:26:05,471 - MainThread - awscli.clidriver - DEBUG - OrderedDict([('cluster', <awscli.arguments.CLIArgument object at 0x7f72875ee350>), ('service', <awscli.arguments.CLIArgument object at 0x7f72875ee450>), ('desired-count', <awscli.arguments.CLIArgument object at 0x7f72875ee5d0>), ('task-definition', <awscli.arguments.CLIArgument object at 0x7f72875ee710>), ('capacity-provider-strategy', <awscli.arguments.ListArgument object at 0x7f72875ee810>), ('deployment-configuration', <awscli.arguments.CLIArgument object at 0x7f72875ee890>), ('network-configuration', <awscli.arguments.CLIArgument object at 0x7f72875ee990>), ('placement-constraints', <awscli.arguments.ListArgument object at 0x7f72875f0110>), ('placement-strategy', <awscli.arguments.ListArgument object at 0x7f72875f0290>), ('platform-version', <awscli.arguments.CLIArgument object at 0x7f72875f03d0>), ('force-new-deployment', <awscli.arguments.BooleanArgument object at 0x7f72875f04d0>), ('no-force-new-deployment', <awscli.arguments.BooleanArgument object at 0x7f72875f0550>), ('health-check-grace-period-seconds', <awscli.arguments.CLIArgument object at 0x7f72875f0650>), ('enable-execute-command', <awscli.arguments.BooleanArgument object at 0x7f72875f07d0>), ('no-enable-execute-command', <awscli.arguments.BooleanArgument object at 0x7f72875f0890>), ('enable-ecs-managed-tags', <awscli.arguments.BooleanArgument object at 0x7f72875f0a10>), ('no-enable-ecs-managed-tags', <awscli.arguments.BooleanArgument object at 0x7f72875f09d0>), ('load-balancers', <awscli.arguments.ListArgument object at 0x7f72875f0c10>), ('propagate-tags', <awscli.arguments.CLIArgument object at 0x7f72875f0e10>), ('service-registries', <awscli.arguments.ListArgument object at 0x7f72875f0f90>), ('service-connect-configuration', <awscli.arguments.CLIArgument object at 0x7f72875f1050>)])
2023-05-04 15:26:05,471 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ecs.update-service: calling handler <function add_streaming_output_arg at 0x7f728899c0e0>
2023-05-04 15:26:05,471 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ecs.update-service: calling handler <function rename_arg.<locals>._rename_arg at 0x7f728832e980>
2023-05-04 15:26:05,471 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ecs.update-service: calling handler <function add_cli_input_json at 0x7f7289949760>
2023-05-04 15:26:05,471 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ecs.update-service: calling handler <function add_cli_input_yaml at 0x7f7289949b20>
2023-05-04 15:26:05,471 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ecs.update-service: calling handler <function unify_paging_params at 0x7f72891d8ae0>
2023-05-04 15:26:05,491 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.11.17/dist/awscli/botocore/data/ecs/2014-11-13/paginators-1.json
2023-05-04 15:26:05,491 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.ecs.update-service: calling handler <function add_generate_skeleton at 0x7f7288dc3100>
2023-05-04 15:26:05,492 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.ecs.update-service: calling handler <bound method OverrideRequiredArgsArgument.override_required_args of <awscli.customizations.cliinput.CliInputJSONArgument object at 0x7f72875f1490>>
2023-05-04 15:26:05,492 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.ecs.update-service: calling handler <bound method OverrideRequiredArgsArgument.override_required_args of <awscli.customizations.cliinput.CliInputYAMLArgument object at 0x7f72875db590>>
2023-05-04 15:26:05,492 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.ecs.update-service: calling handler <bound method GenerateCliSkeletonArgument.override_required_args of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x7f72875f30d0>>
2023-05-04 15:26:05,492 - MainThread - botocore.hooks - DEBUG - Event building-command-table.ecs_update-service: calling handler <function add_waiters at 0x7f728899d620>
2023-05-04 15:26:05,492 - MainThread - botocore.hooks - DEBUG - Event building-command-table.ecs_update-service: calling handler <bound method AliasSubCommandInjector.on_building_command_table of <awscli.alias.AliasSubCommandInjector object at 0x7f728834b550>>
2023-05-04 15:26:05,494 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.cluster: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,494 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.ecs.update-service: calling handler <awscli.argprocess.ParamShorthandParser object at 0x7f72891006d0>
2023-05-04 15:26:05,494 - MainThread - awscli.arguments - DEBUG - Unpacked value of '"arn:aws:ecs:(region):(account id):cluster/nginx-with-html"' for parameter "cluster": '"arn:aws:ecs:(region):(account id):cluster/nginx-with-html"'
2023-05-04 15:26:05,494 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.service: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,494 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.ecs.update-service: calling handler <awscli.argprocess.ParamShorthandParser object at 0x7f72891006d0>
2023-05-04 15:26:05,494 - MainThread - awscli.arguments - DEBUG - Unpacked value of '"nginx-with-html-service"' for parameter "service": '"nginx-with-html-service"'
2023-05-04 15:26:05,494 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.desired-count: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,494 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.task-definition: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,494 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.ecs.update-service: calling handler <awscli.argprocess.ParamShorthandParser object at 0x7f72891006d0>
2023-05-04 15:26:05,494 - MainThread - awscli.arguments - DEBUG - Unpacked value of 'nginx-with-html' for parameter "task_definition": 'nginx-with-html'
2023-05-04 15:26:05,494 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.capacity-provider-strategy: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,494 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.deployment-configuration: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,494 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.network-configuration: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,495 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.placement-constraints: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,495 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.placement-strategy: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,495 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.platform-version: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,495 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.force-new-deployment: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,495 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.health-check-grace-period-seconds: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,495 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.enable-execute-command: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,496 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.enable-ecs-managed-tags: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,496 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.load-balancers: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,496 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.propagate-tags: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,496 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.service-registries: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,496 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.service-connect-configuration: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,496 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.cli-input-json: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,496 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.cli-input-yaml: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,496 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ecs.update-service.generate-cli-skeleton: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f72883835d0>
2023-05-04 15:26:05,496 - MainThread - botocore.hooks - DEBUG - Event calling-command.ecs.update-service: calling handler <bound method CliInputArgument.add_to_call_parameters of <awscli.customizations.cliinput.CliInputJSONArgument object at 0x7f72875f1490>>
2023-05-04 15:26:05,496 - MainThread - botocore.hooks - DEBUG - Event calling-command.ecs.update-service: calling handler <bound method CliInputArgument.add_to_call_parameters of <awscli.customizations.cliinput.CliInputYAMLArgument object at 0x7f72875db590>>
2023-05-04 15:26:05,496 - MainThread - botocore.hooks - DEBUG - Event calling-command.ecs.update-service: calling handler <bound method GenerateCliSkeletonArgument.generate_skeleton of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x7f72875f30d0>>
2023-05-04 15:26:05,497 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env
2023-05-04 15:26:05,497 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role
2023-05-04 15:26:05,497 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role-with-web-identity
2023-05-04 15:26:05,497 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: sso
2023-05-04 15:26:05,497 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file
2023-05-04 15:26:05,498 - MainThread - botocore.credentials - INFO - Found credentials in shared credentials file: ~/.aws/credentials
2023-05-04 15:26:05,500 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.11.17/dist/awscli/botocore/data/endpoints.json
2023-05-04 15:26:05,520 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x7f728c1f4540>
2023-05-04 15:26:05,538 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.11.17/dist/awscli/botocore/data/ecs/2014-11-13/endpoint-rule-set-1.json
2023-05-04 15:26:05,538 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.11.17/dist/awscli/botocore/data/partitions.json
2023-05-04 15:26:05,540 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.ecs: calling handler <function add_generate_presigned_url at 0x7f728c1aa480>
2023-05-04 15:26:05,546 - MainThread - botocore.endpoint - DEBUG - Setting ecs timeout as (60, 60)
2023-05-04 15:26:05,548 - MainThread - botocore.regions - DEBUG - Calling endpoint provider with parameters: {'Region': 'ap-northeast-1', 'UseDualStack': False, 'UseFIPS': False}
2023-05-04 15:26:05,548 - MainThread - botocore.regions - DEBUG - Endpoint provider result: https://ecs.ap-northeast-1.amazonaws.com
2023-05-04 15:26:05,549 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.ecs.UpdateService: calling handler <function base64_decode_input_blobs at 0x7f7288312d40>
2023-05-04 15:26:05,549 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.ecs.UpdateService: calling handler <function generate_idempotent_uuid at 0x7f728bd7c040>
2023-05-04 15:26:05,549 - MainThread - botocore.hooks - DEBUG - Event before-call.ecs.UpdateService: calling handler <function inject_api_version_header_if_needed at 0x7f728bd7db20>
2023-05-04 15:26:05,549 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=UpdateService) with params: {'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'X-Amz-Target': 'AmazonEC2ContainerServiceV20141113.UpdateService', 'Content-Type': 'application/x-amz-json-1.1', 'User-Agent': 'aws-cli/2.11.17 Python/3.11.3 Linux/5.19.0-1024-aws exe/x86_64.ubuntu.22 prompt/off command/ecs.update-service'}, 'body': b'{"cluster": "\\"arn:aws:ecs:(region):(account id):cluster/nginx-with-html\\"", "service": "\\"nginx-with-html-service\\"", "taskDefinition": "nginx-with-html"}', 'url': 'https://ecs.ap-northeast-1.amazonaws.com/', 'context': {'client_region': '(region)', 'client_config': <botocore.config.Config object at 0x7f72865525d0>, 'has_streaming_input': False, 'auth_type': None}}
2023-05-04 15:26:05,549 - MainThread - botocore.hooks - DEBUG - Event request-created.ecs.UpdateService: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f72875f0190>>
2023-05-04 15:26:05,549 - MainThread - botocore.hooks - DEBUG - Event choose-signer.ecs.UpdateService: calling handler <function set_operation_specific_signer at 0x7f728bd5fec0>
2023-05-04 15:26:05,550 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2023-05-04 15:26:05,550 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
POST
/

content-type:application/x-amz-json-1.1
host:ecs.(region).amazonaws.com
x-amz-date:20230504T152605Z
x-amz-target:AmazonEC2ContainerServiceV20141113.UpdateService

content-type;host;x-amz-date;x-amz-target
3007f8e86fa098454e3cc42a7a1f8467fd5241e14fcb839803cec653d0c0b285
2023-05-04 15:26:05,550 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20230504T152605Z
20230504/(region)/ecs/aws4_request
569280dc8dbfd8c554e7e67da9619c550cd5ac6927eef297232656dce8ddac7c
2023-05-04 15:26:05,550 - MainThread - botocore.auth - DEBUG - Signature:
f0e811e99094654b546f8c5de7a71ee64e162afb23610bc513e8a29ac38416a2
2023-05-04 15:26:05,550 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://ecs.(region).amazonaws.com/, headers={'X-Amz-Target': b'AmazonEC2ContainerServiceV20141113.UpdateService', 'Content-Type': b'application/x-amz-json-1.1', 'User-Agent': b'aws-cli/2.11.17 Python/3.11.3 Linux/5.19.0-1024-aws exe/x86_64.ubuntu.22 prompt/off command/ecs.update-service', 'X-Amz-Date': b'20230504T152605Z', 'Authorization': b'AWS4-HMAC-SHA256 Credential=(access key id)/20230504/ap-northeast-1/ecs/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=f0e811e99094654b546f8c5de7a71ee64e162afb23610bc513e8a29ac38416a2', 'Content-Length': '161'}>
2023-05-04 15:26:05,551 - MainThread - botocore.httpsession - DEBUG - Certificate path: /usr/local/aws-cli/v2/2.11.17/dist/awscli/botocore/cacert.pem
2023-05-04 15:26:05,551 - MainThread - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): ecs.(region).amazonaws.com:443
2023-05-04 15:26:05,585 - MainThread - urllib3.connectionpool - DEBUG - https://ecs.(region).amazonaws.com:443 "POST / HTTP/1.1" 400 85
2023-05-04 15:26:05,586 - MainThread - botocore.parsers - DEBUG - Response headers: {'x-amzn-RequestId': '596dfb03-9b9b-4260-8730-0d29aadbc0ee', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '85', 'Date': 'Thu, 04 May 2023 15:26:04 GMT', 'Connection': 'close'}
2023-05-04 15:26:05,586 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"__type":"InvalidParameterException","message":"Unsupported resource type: cluster"}'
2023-05-04 15:26:05,587 - MainThread - botocore.parsers - DEBUG - Response headers: {'x-amzn-RequestId': '596dfb03-9b9b-4260-8730-0d29aadbc0ee', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '85', 'Date': 'Thu, 04 May 2023 15:26:04 GMT', 'Connection': 'close'}
2023-05-04 15:26:05,587 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"__type":"InvalidParameterException","message":"Unsupported resource type: cluster"}'
2023-05-04 15:26:05,588 - MainThread - botocore.hooks - DEBUG - Event needs-retry.ecs.UpdateService: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x7f7286558590>>
2023-05-04 15:26:05,588 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2023-05-04 15:26:05,588 - MainThread - botocore.hooks - DEBUG - Event after-call.ecs.UpdateService: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x7f7286552650>>
2023-05-04 15:26:05,588 - MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
  File "awscli/clidriver.py", line 460, in main
  File "awscli/clidriver.py", line 595, in __call__
  File "awscli/clidriver.py", line 798, in __call__
  File "awscli/clidriver.py", line 929, in invoke
  File "awscli/clidriver.py", line 941, in _make_client_call
  File "awscli/botocore/client.py", line 341, in _api_call
  File "awscli/botocore/client.py", line 697, in _make_api_call
botocore.errorfactory.InvalidParameterException: An error occurred (InvalidParameterException) when calling the UpdateService operation: Unsupported resource type: cluster

Reproduction Steps

Actually, I executed the command line as a part of an open-source CI/CD pipeline called Concourse CI.

Here is the procedure that you may reproduce this bug

  1. Install Concourse CI and fly binary to your EC2 instance

  2. Build a docker image of nginx-with-html and push that to your ECR repo (https://github.com/makotonakai/nginx-with-html)

  3. Create the following file called pipeline.yml

resource_types:
  - name: ecs-resource-type
    type: registry-image
    source:
      repository: makotonakai/concourse-ecs-resource

resources:
  - name: ecs-resource
    type: ecs-resource-type
    source:  
      aws_access_key_id: (your access key id)
      aws_secret_access_key: (your secret access key)
      aws_region: (your aws region)

jobs:
  - name: update
    plan:
      - put: ecs-resource
        params:
          cluster_arn: arn:aws:ecs:(your region):(your account id):cluster/(your ecs cluster)
          service: nginx-with-html-service
          task_definition.json: '{
    "taskDefinitionArn": "arn:aws:ecs:(your region):(your account id):task-definition/nginx-with-html:1",
    "containerDefinitions": [
      {
        "name": "nginx-with-html",
        "image": "(your account id).dkr.ecr.(your region).amazonaws.com/nginx-with-html:latest",
        "cpu": 0,
        "portMappings": [
          {
            "name": "nginx-with-html-80-tcp",
            "containerPort": 80,
            "hostPort": 80,
            "protocol": "tcp",
            "appProtocol": "http"
          }  
        ],
        "essential": true,
        "environment": [],
        "environmentFiles": [],
        "mountPoints": [],
        "volumesFrom": [],
        "healthCheck": {
          "command": [
            "CMD-SHELL",
            "service nginx status || exit 1"
          ],
          "interval": 10,
          "timeout": 5,
          "retries": 3,
          "startPeriod": 10
         }
      }
    ],
    "family": "nginx-with-html",
    "taskRoleArn": "arn:aws:iam::(your account id):role/ecsTaskExecutionRole",
    "executionRoleArn": "arn:aws:iam::(your account id):role/ecsTaskExecutionRole",
    "networkMode": "awsvpc",
    "revision": 1,
    "volumes": [],
    "status": "ACTIVE",
    "requiresAttributes": [
      {
        "name": "com.amazonaws.ecs.capability.ecr-auth"
    },
    {
      "name": "com.amazonaws.ecs.capability.task-iam-role"
    },
    {
      "name": "ecs.capability.container-health-check"
    },
    {
      "name": "ecs.capability.execution-role-ecr-pull"
    },
    {
      "name": "ecs.capability.extensible-ephemeral-storage"
    },
    {
      "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
    },
    {
      "name": "ecs.capability.task-eni"
    },
    {
      "name": "com.amazonaws.ecs.capability.docker-remote-api.1.29"
    }
  ],
  "placementConstraints": [],
  "compatibilities": [
    "EC2",
    "FARGATE"
  ],
  "requiresCompatibilities": [
    "FARGATE"
  ],
  "cpu": "1024",
  "memory": "3072",
  "ephemeralStorage": {
    "sizeInGiB": 21
  },
  "runtimePlatform": {
    "cpuArchitecture": "X86_64",
    "operatingSystemFamily": "LINUX"
  },
  "registeredAt": "2023-04-24T03:27:52.431Z",
  "registeredBy": "arn:aws:iam::(your account id):root",
  "tags": [
    {
      "key": "key",
      "value": "value"
    }  
  ]
}'
  1. run these commands
    fly -t tutorial login -c http://localhost:8080 -u test -p test
    fly -t tutorial set-pipeline -p pipeline -c pipeline.yml
    fly -t tutorial unpause-pipeline -p pipeline
    fly -t tutorial trigger-job --job pipeline/update --watch

Possible Solution

No response

Additional Information/Context

No response

CLI version used

aws-cli/2.11.17 Python/3.11.3 Linux/5.19.0-1024-aws exe/x86_64.ubuntu.22 prompt/off

Environment details (OS name and version, etc.)

Ubuntu 22.04

tim-finnigan commented 1 year ago

Hi @makotonakai thanks for reaching out. I tried to reproduce this error but was not able to. It looks like the command you provided is slightly different than what is shown in your logs. Do you have any updates as far as what you have tried in the last few days? Here is the command documentation for reference: https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ecs/update-service.html.

github-actions[bot] commented 1 year ago

Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

tony commented 1 year ago

FYI it's possible to get here through search engines and there is no further information - so if you do find more information to what mistake you made / if there's a solution / etc. it would be of help here!

AWS is big enough it's fine to not know everything ahead of time 😄

b3n3d1k7 commented 1 month ago

FYI it's possible to get here through search engines and there is no further information - so if you do find more information to what mistake you made / if there's a solution / etc. it would be of help here!

AWS is big enough it's fine to not know everything ahead of time 😄

Maybe this will help someone: I ran into the same error message (An error occurred (InvalidParameterException) when calling the DescribeTasks operation: Unsupported resource type: cluster) when the bash variable used for the --cluster parameter contained quotes. Once I removed the quotes everything worked fine.