scagnetti
scagnetti

Reputation: 1507

ecs error: "An error occurred (ClusterNotFoundException) when calling the..."

I've defined a cluster in ECS and failed to clean it up properly. I've terminated EC2 instances that are associated with this cluster which get recreated. No clusters/repos/services appear in my ECS console. In fact, when I go to this service through the console, I see the getting started wizard. I've started some digging with the CLI.

When issuing the commands:

I see the message An error occurred (ClusterNotFoundException) when calling the ____ operation: Cluster not found. (even when including my region).

When issuing the command:

I get the result:

{
    "clusters": [],
    "failures": [
        {
            "arn": "arn:aws:ecs:us-east-1:123456789012:cluster/default",
            "reason": "MISSING"
        }
    ]
}

Any ideas on how I can clean up my mess would be much appreciated. Thanks!

Upvotes: 24

Views: 30308

Answers (4)

user2672498
user2672498

Reputation: 17

aws ecs describe-services --services --cluster --region

Upvotes: 0

Rashni Ghosh
Rashni Ghosh

Reputation: 29

I hope your cli is configured for a default region that is different than where the cluster is. Do 'aws configure' and change the region.

Upvotes: 3

A.Carle
A.Carle

Reputation: 160

The command aws ecs describe-clusters only shows your default cluster.

You should write aws ecs describe-clusters --cluster <your-cluster> to check if it was correctly cleaned up.

Upvotes: 11

scagnetti
scagnetti

Reputation: 1507

There was a CloudFormation listing this cluster in its configuration. Even though this cluster was not visible in the ECS console, a CloudFormation stack was creating EC2 instances using the deleted cluster configuration. The CloudFormation stack was responsible for these EC2 instances. Deleting the stack solved this issue.

Upvotes: 11

Related Questions