aws / amazon-ssm-agent

An agent to enable remote management of your EC2 instances, on-premises servers, or virtual machines (VMs).

Home Page:https://aws.amazon.com/systems-manager/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

monelgordillo opened this issue · comments

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.

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

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