Sourabh
Sourabh

Reputation: 769

No Fargate configuration exists for given values for Jenkins amazon-ecs-plugin

I am trying to use recently released amazon-ecs-plugin:1.15 which support fargate but I am getting below error.

WARNING: Slave {0} - Cannot create ECS Task
May 24, 2018 1:10:39 PM hudson.slaves.NodeProvisioner$2 run
WARNING: Unexpected exception encountered while provisioning agent ECS Slave ecs-jenkins-slave
com.amazonaws.services.ecs.model.ClientException: No Fargate configuration exists for given values. (Service: AmazonECS; Status Code: 400; Error Code: ClientException; Request ID:****-****)

Here is my config

Upvotes: 42

Views: 24471

Answers (3)

user6327093
user6327093

Reputation:

Check your CPU and memory amounts; you need to follow specific combinations:

CPU value       Memory value (MiB)
256 (.25 vCPU)  512 (0.5GB), 1024 (1GB), 2048 (2GB)
512 (.5 vCPU)   1024 (1GB), 2048 (2GB), 3072 (3GB), 4096 (4GB) 
1024 (1 vCPU)   2048 (2GB), 3072 (3GB), 4096 (4GB), 5120 (5GB), 6144 (6GB), 7168 (7GB), 8192 (8GB) 
2048 (2 vCPU)   Between 4096 (4GB) and 16384 (16GB) in increments of 1024 (1GB) 
4096 (4 vCPU)   Between 8192 (8GB) and 30720 (30GB) in increments of 1024 (1GB) 
8192 (8 vCPU)   Between 16 GB and 60 GB in 4 GB increments
16384 (16vCPU)  Between 32 GB and 120 GB in 8 GB increments

Reference: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html

Upvotes: 84

user35-02900
user35-02900

Reputation: 71

when deploying app using AWS COPILOT, got:

An ECS task definition to group your containers and run them on ECS              [delete complete]     [3.4s]
    Resource handler returned message: "Invalid request provided: Create T
    askDefinition: **No Fargate configuration exists for given values: 512 C
    PU, 512 memory**. See the Amazon ECS documentation for the valid values.
     (Service: AmazonECS; Status Code: 400; Error Code: ClientException; R
    equest ID: 6db81468-6c2a-404c-a97c-a03d59053523; Proxy: null)" (Reques
    tToken: 9cb92f50-d7a5-6473-6cb4-2073a165bf8b, HandlerErrorCode: Invali
    dRequest)

Solved by changing in manifest.yml under the relevant copilot service folder: from "cpu: 512" to "cpu: 256", like below:

# Number of CPU units and memory (in MiB) allocated to each task.
cpu: 256
memory: 512

Refer to: https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/

Combinations of CPU and Memory must be like answer above: https://stackoverflow.com/a/54526354/3502900

Upvotes: 0

Promise Preston
Promise Preston

Reputation: 29068

To add to user6327093's answer

I had a similar issue when trying to create resources on AWS ECS using Terraform. The error was:

Error: ClientException: No Fargate configuration exists for given values.

Here's how I fixed it:

You must adhere to the supported task CPU and memory values for tasks that are hosted on Fargate are as follows.

CPU value Memory value (MiB)
256 (.25 vCPU) 512 (0.5GB), 1024 (1GB), 2048 (2GB)
512 (.5 vCPU) 1024 (1GB), 2048 (2GB), 3072 (3GB), 4096 (4GB)
1024 (1 vCPU) 2048 (2GB), 3072 (3GB), 4096 (4GB), 5120 (5GB), 6144 (6GB), 7168 (7GB), 8192 (8GB)
2048 (2 vCPU) Between 4096 (4GB) and 16384 (16GB) in increments of 1024 (1GB)
4096 (4 vCPU) Between 8192 (8GB) and 30720 (30GB) in increments of 1024 (1GB)

In my case, the CPU was 4096, while the memory was 32768 (32GB). However, 32768 (32GB) memory is not supported by Fargate from the table above, so I had to change the memory to 30720 (30GB).

Resources: Invalid CPU or memory value specified

That's all

Upvotes: 18

Related Questions