aws / amazon-ssm-agent

An agent to enable remote management of your EC2 instances, on-premises servers, or virtual machines (VMs).
https://aws.amazon.com/systems-manager/
Apache License 2.0
1.06k stars 326 forks source link

An error occurred (TargetNotConnectedException) when calling the ExecuteCommand operation: The execute command failed due to an internal error. Try again later. #536

Open monelgordillo opened 1 year ago

monelgordillo commented 1 year ago

I am getting this error:

aws ecs execute-command --region REGION --cluster CLUSTER --task TASK --container CONTAINER --command "/bin/sh" --interactive

The Session Manager plugin was installed successfully. Use the AWS CLI to start a session.

An error occurred (TargetNotConnectedException) when calling the ExecuteCommand operation: The execute command failed due to an internal error. Try again later.

amazon-ssm-agent --version SSM Agent version: 3.1.804.0

This is running on EC2 infrastructure within the ECS cluster.

monelgordillo commented 1 year ago

I had to downgrade ecs agent to 1.55.4, instead of 1.58.0.

ziwangj commented 1 year ago

Thanks for reaching out, could you please refer to this documentation for troubleshooting. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html#ecs-exec-troubleshooting