amazon-ssm-agent icon indicating copy to clipboard operation
amazon-ssm-agent copied to clipboard

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

Open monelgordillo opened this issue 1 year ago • 2 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.

monelgordillo avatar Sep 18 '23 15:09 monelgordillo

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

monelgordillo avatar Sep 18 '23 20:09 monelgordillo

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

ziwangj avatar Sep 26 '23 18:09 ziwangj