ECS Agent on the Container Instance Is Unstable

0

I have a backend app that I have dockerized and want to run it on ECS using EC2 Launch Type , This backend app Is connected to RDS Instance In another account (i.e. backend app and RDS Instance are not In the same VPC) , So I have set up a VPC Peering Connection between them both

This Is link to original question

https://repost.aws/questions/QUrrt5HgwfS4SvAyf1bXiNlw/unable-to-register-a-container-instance-with-ecs

The Task Is In Provisioning Status Indefinitely , I have Inspected the ecs.agent.log and I can see the following output in a repetitive way

Connected to TCS endpoint

Websocket connection established.

Connected to ACS endpoint

Successfully loaded ebs-csi-driver container image from tarball

"Successfully loaded Managed Daemon image

Image excluded from cleanup" image="ebs-csi-driver:latest"

TCS WebSocket connection closed for a valid reason

Reconnecting to ACS immediately without waiting

Using cached DiscoverPollEndpoint

Establishing a Websocket connection

Websocket connection established

Connected to ACS endpoint
Mahmoud
asked 10 days ago266 views
2 Answers
1

Hi,

Please look at my solution it will be helpful for you.

Firstly, ensure stable network connectivity between your container instance and the ECS control plane. Any network issues or restrictions hindering this connection could disrupt the ECS agent's ability to communicate effectively.

Secondly, review the configuration of the VPC peering connection between your ECS VPC and the RDS VPC. Confirm that the peering connection allows for proper traffic flow and that all necessary route table entries and security group rules are correctly configured.

Next, inspect the ECS agent configuration on your container instance. Ensure that it is properly configured, including any environment variables or parameters related to VPC peering and connectivity. Any misconfiguration here could lead to instability.

Consider updating the ECS agent to the latest version. Newer versions often include bug fixes and improvements that address instability issues. This update may help resolve the provisioning problem you're experiencing.

Check whether you've exceeded any ECS service limits, such as the maximum number of container instances or tasks allowed in your account. Exceeding these limits could cause unexpected behavior and instability.

Continuously monitor the ECS agent logs for any error messages or warnings that could provide insight into the cause of the instability. Look for patterns or recurring issues that may indicate underlying problems.

answered 10 days ago
0

I'd recommend you to use the ECS Logging collector script which would provide all logs to help you to troubleshoot the issue. This is the same script used by AWS Premium Support Engineers and ECS Service team to help the customers.

If you have support plan, you can also open a case with the logs to have it checked by one of our specialist.

profile pictureAWS
answered 9 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions