I am running aws ecs execute-command --cluster UltimaF --task 838d773b17954bcfbbacf343fb4fea70 --container ultima --interactive --command "/bin/sh"
Getting back: An error occurred (InvalidParameterException) when calling the ExecuteCommand operation: The execute command failed because execute command was not enabled when the task was run or the execute command agent isn’t running. Wait and try again or run a new task with execute command enabled and try again.
I have ensured that:
aws ecs describe-tasks --cluster UltimaF --tasks 838d773b17954bcfbbacf343fb4fea70 returns "enableExecuteCommand": truessmmessages:CreateControlChannelssmmessages:CreateDataChannelssmmessages:OpenControlChannelssmmessages:OpenDataChannelI am running on Windows, aws-cli/2.8.2
UPDATE: after running ecs exec checker I have two yellow items and one red:
----------
Managed Agent Status
----------
1. STOPPED (Reason: null) for "ultima" - LastStartedAt: null
----------
Init Process Enabled (first-run-task-definition:12)
----------
1. Disabled - "ultima"
UPDATE two:
This issue suggests
ecs:clustername_taskid_containerruntimeid but for me it returns an error: An error occurred (TargetNotConnected) when calling the StartSession operation: ecs:UltimaF_838d773b17954bcfbbacf343fb4fea70_838d773b17954bcfbbacf343fb4fea70-2587323273 is not connected.
Question: How do I connect?
Try this
aws ecs update-service --cluster <cluster-name> --service <service-name> --force-new-deployment --enable-execute-command.This will enable it
Make sure that in your task definition's structure/JSON "enableExecuteCommand" is set to true.
aws ecs describe-tasks --cluster <CLUSTER> --tasks <TASK_ARN>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With