Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

523
Vistas
resource:memory error when trying to run an ECS task using AWS CLI

I'm trying to set up CI with AWS ECS and docker. I use Codeship as a CI tool, but that should not really matter much.

I do the following steps in a shell script:

  • build an image with my Dockerfile,
  • push the image to ECS repository,
  • push a task-definition.json to ECS aws ecs register-task-definition --family postgraphile --cli-input-json file:///deploy/ecs-task-def.json --region us-east-2
  • run the ECS task aws ecs run-task --task-definition postgraphile --cluster testcluster --region us-east-2

Shell script runs successfully, however I see an error in output after I try to run my ECS task:

{
    "tasks": [],
    "failures": [
        {
            "arn": "arn:aws:ecs:us-east-2:99999999999:container-instance/050ab165-7669-45d5-8be7-d990cf4fff42",
            "reason": "RESOURCE:MEMORY"
        }
    ]
}

my ecs-task-def.json:

{
  "containerDefinitions": [
    {
      "name": "postgraphile-container",
      "image": "999999999999.dkr.ecr.us-east-2.amazonaws.com/test-repository",
      "memory": 500,
      "essential": true,
      "portMappings": [
        {
          "hostPort": 5000,
          "containerPort": 5000
        }
      ]
    }
  ],
  "volumes": [],
  "memory": "900",
  "cpu": "128",
  "placementConstraints": [],
  "family": "postgraphile",
  "taskRoleArn": ""
}

I think I already checked all the memory limits.. am I missing anything?

UPDATE: After couple of reboots of ec2 instance I can finally run the ecs task with no errors. After running task several times, the error returns

9 months ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

I was getting this error when deploying a service on an ECS cluster. Removing the service completely and then redeploying it afresh helped me resolve this issue.

9 months ago · Santiago Trujillo Denunciar

0

I had faced similar error while deploying services to EC2 using docker. I was using putty not CLI. I ran command docker images to get the size of each image. I found total size was more than my EC2 instance storage. I increased the EC2 instance volume to 20GB (EC2-->Volume-->Modify volume). Issue was resolved. Later I faced issue again after multiple trial and error. This time, I found I had lot of unused images which got accumulated after multiple docker compose commands. I removed all the containers, volumes and images and memory error was resolved.

9 months ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.