question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Step fails with "Resource is not in the state servicesStable" but new task is running successfully in ECS

See original GitHub issue

I’ve defined a aws-actions/amazon-ecs-deploy-task-definition@v1 step on my workflow file, and that step keeps failing:

Run aws-actions/amazon-ecs-deploy-task-definition@v1
  with:
    task-definition: /home/runner/work/_temp/task-definition-31660kV60ttYXRWu.json
    service: my-service-staging
    cluster: my-cluster
    wait-for-service-stability: true
  env:
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
    AWS_DEFAULT_REGION: us-east-2
    AWS_REGION: us-east-2
    JAVA_HOME: /opt/hostedtoolcache/jdk/8.0.242/x64
    JAVA_HOME_8.0.242_x64: /opt/hostedtoolcache/jdk/8.0.242/x64
##[error]Resource is not in the state servicesStable
##[error]Node run failed with exit code 1

The step hangs for a good 5-10 minutes meanwhile, in ECS I can verify that I have 2 tasks in the RUNNING state: the old one and the new one.

After a while, the step fails, but the application is successfully updated in ECS.

It seems that the step times out while waiting for the service to reach a stable state, which is a desired count of 1. But I’m not 100% sure.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
clareliguoricommented, Apr 3, 2020

@ahmednkhan24 you’ll need to look at your service in the ECS console to determine why the deployment did not succeed. For example, look at the Events tab, and look under “Stopped” tasks in the Tasks tab.

8reactions
ahmednkhan24commented, Apr 2, 2020

Hi, I am trying to deploy a simple node API (found here), and I seem to be getting a similar error when trying to use the GithubActions workflow.

I haven’t set up a Load Balancer since it was a demo application, so I was wondering if there could be another solution to fixing this failed build?

As you can see, the build hung for around 30 minutes:

Screen Shot 2020-04-02 at 6 13 47 PM
Read more comments on GitHub >

github_iconTop Results From Across the Web

Amazon ECS with GitHub Actions Stuck on Deploying ECS ...
I had a similar error (Error: Resource is not in the state servicesStable) that was solved after I increased the memory on my...
Read more >
Stop an Amazon ECS service from failing to stabilize in AWS ...
A service created in Amazon ECS fails to stabilize if it isn't in the state specified by the AWS CloudFormation template.
Read more >
aws_ecs_service | Resources | hashicorp/aws
Provides an ECS service - effectively a task that is expected to run until an error occurs or a user terminates it (typically...
Read more >
5 Steps: Using Amazon ECS Exec to pass through Fargate ...
Today I was chasing the information of AWS Pi Week to celebrate AWS 15th Anniversary for S3 Birthday, but I am also very...
Read more >
ecs - Go Packages
This happens when any of your container instances are in the DRAINING state if the service contains tasks using the EC2 launch type....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found