What was reported:
Issue aws/aws-cli#9070 (closed, 15 comments): ### Describe the bug I am unable to use ecs execute-command to connect to my ecs fargate task ### Regression Issue - [X] Select this option if this issue appears to be a regression. ### Expected Behavior I should be able to connect to my ecs fargate task ### Current Behavior It fails to connect to ecs fargate task command ``` aws ecs execute-command \ --region us-west-2 \ --cluster core-services \ --task d179d101efa94c98aa62340b5705d726 \ --container app \ --command "/bin/bash" \ --interactive ``` Error ``` The Session Manager plugin was installed successfully.
What works:
If ecs execute-command fails with TargetNotConnectedException even though the agent looks healthy, look at your sidecars. One user fixed it by removing the Fluent Bit log router container, and another by disabling Datadog-agent logging. Logging sidecars can interfere with the SSM session the exec command needs, so disable them one at a time to find the culprit. Treat this as a diagnosis step, not a universal fix.