-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws ecs execute-command fails with TargetNotConnectedException #9070
Comments
Thanks for reaching out. The In this troubleshooting post for it says you might get that error for the following reasons:
Others have suggested that the issue could be fixed by changing your environment variables or updating your AMI. Also could you explain why you marked this as |
Hi @tim-finnigan 👋 Yeah I have looked at most of those past issues, but I will look again to make sure I didn't miss any potential solutions. For context, I'm using ecs fargate, platform version 1.4 Things I've tried to fix this:
ecs exec used to work for me, so I thought it would be ok to mark this as a regression. But this is only conjecture on my part, so please remove the tag if you feel it is appropriate! |
Just to chime in on a potential regression: We are also experiencing this issue with Fargate where things were working fine, and then seemingly stopped working suddenly for no apparent reason. |
Thanks for following up - we may need to loop in ECS/Fargate here as well. Did this issue start occurring after updating to a specific version? Could you share your debug logs (with any sensitive info redacted) to help with further investigation? |
@tim-finnigan - I...spoke too soon when chiming in above 😅 . I believe the issue was a bug in our infrastructure as code which caused some non-determinism related to the subnet associated with tasks. A container cycle caused some to land in an isolated subnet inadvertently, and that was the root issue for the "suddenly for no apparent reason". Fixing the IaC issue solved our problem. |
No worries, thanks for following up and glad that issue is resolved. For the original issue author — I'll mention this troubleshooting guide again for reference: https://repost.aws/knowledge-center/fargate-ecs-exec-errors. If you're still seeing the issue, please share your debug logs for further investigation. |
I've narrowed the problem down to a sidecar container [ Do you happen to know if there are any known issues that would cause fluent bit to interfere with ecs exec? This is the relevant part of the task def {
"name": "log-router",
"image": "amazon/aws-for-fluent-bit:stable",
"cpu": 0,
"portMappings": [],
"essential": false,
"environment": [],
"mountPoints": [],
"volumesFrom": [],
"user": "0",
"dockerLabels": {
"com.datadoghq.tags.service": "log-router",
"com.datadoghq.tags.env": "dev"
},
"systemControls": [],
"firelensConfiguration": {
"type": "fluentbit",
"options": {
"config-file-type": "file",
"config-file-value": "/fluent-bit/configs/parse-json.conf",
"enable-ecs-log-metadata": "true"
}
}
} |
confirmed that removing |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Hey @leejayhsu we are facing the same problem. I assume removing the |
hi @lkashef 👋 sorry this probably isn't the answer you were hoping for! |
@lkashef I also had another task which I couldn't exec into, and disabling logging in the datadog-agent container fixed it (this was quite unexpected). |
Describe the bug
I am unable to use ecs execute-command to connect to my ecs fargate task
Regression Issue
Expected Behavior
I should be able to connect to my ecs fargate task
Current Behavior
It fails to connect to ecs fargate task
command
Error
amazon-ecs-exec-checker output
Reproduction Steps
run this command:
Possible Solution
No response
Additional Information/Context
No response
CLI version used
2.19.4
Environment details (OS name and version, etc.)
Python/3.12.7 Darwin/24.0.0 source/arm64
The text was updated successfully, but these errors were encountered: