boltops-tools / boltops-tools/ufo

ECS Service Creation Stuck Due to No Available Container Instances

Open
#181 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Ruby
Stars
219
Forks
26
PR merge metrics
No merged PRs in 30d

Description

## Checklist

* [x] Upgrade UFO: I am using the latest version of UFO.
* [x] Reproducibility: This is a reproducible bug.
* [x] Code sample: Included below.

## My Environment

| Software | Version |
| ---------------- | --------------------- |
| Operating System | macOS / WSL (Windows) |
| UFO | Latest |
| Ruby | 3.3.0, 3.2.2 |

- - -

## Expected Behaviour

The `ufo ship` command should deploy the ECS service without any issues, creating the necessary ECS cluster and running the tasks as expected.

## Current Behavior

The `ufo ship` command gets stuck at the ECS service creation step, displaying the error message:

```bash
CREATE_IN_PROGRESS AWS::ECS::Service EcsService Eventual consistency check initiated
```

The error in AWS reads:

```plaintext
service demo-web-dev-EcsService-QY7NEm2trctk was unable to place a task because no container instance met all of its requirements. Reason: No Container Instances were found in your cluster. For more information, see the Troubleshooting section of the Amazon ECS Developer Guide.
```

## Step-by-step reproduction instructions

1. Install UFO:

```bash
gem install ufo
```

2. Set up AWS config and credentials:

```bash
# ~/.aws/config
[dev]
region = us-west-1
output = json

# ~/.aws/credentials
[dev]
aws_access_key_id=REPLACE_ME
aws_secret_access_key=REPLACE_ME
```

3. Set AWS\_PROFILE and verify credentials:

```bash
export AWS_PROFILE=dev
aws sts get-caller-identity
aws s3 ls
```

4. Create ECS cluster named `dev` in the `us-west-1` region:

```bash
aws ecs describe-clusters --clusters dev --region us-west-1 --profile dev
```

5. Set up the demo project:

```bash
mkdir demo && cd demo
aws ecr create-repository --repository-name demo
REPO=$(aws ecr describe-repositories --region us-west-1 --profile dev --repository-name demo | jq -r '.repositories[].repositoryUri')
echo $REPO
AWS_PROFILE=dev ufo init --app demo --repo $REPO
```

6. Ship the code:

```bash
AWS_PROFILE=dev ufo ship -y
```

7. Observe the error:

```bash
CREATE_IN_PROGRESS AWS::ECS::Service EcsService Eventual consistency check initiated
```

## Code Sample

Here is the relevant code and configurations used during the process:

* [Gist of my notes](https://gist.github.com/loftwah/80e1169d879c266b3558b897e47b3641)

## Solution Suggestion

Unsure. This prevented me from getting going with UFO.

Contributor guide

Open the contributing guide

Research direction

Start with the `ufo ship -y` entry point and reproduce the deployment using the documented `dev` ECS cluster in `us-west-1`. Trace the ECS service creation and task-placement status behind the `CREATE_IN_PROGRESS` message; done means the reported deployment behavior is addressed when no container instance is available, with the documented reproduction completing or failing clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, ruby
Domain
cloud, devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.