Hi All, I get this error when running say large a...
# ask-community
r
Hi All, I get this error when running say large amount of flows at a time. I am using ECS task to run the flow from docker. Error: when calling the RegisterTaskDefinition operation: Too many concurrent attempts to create a new revision of the specified family. I have not passed Task Definition, so letting Prefect Generate it. However I see prefect always generates/registers new type definition with no changes except incremeting task definition version and registered at, by changes I already have these envirnment variables on Worker Pool / Agent
Copy code
'AWS_RETRY_MODE': 'adaptive',
  'AWS_MAX_ATTEMPTS': '100'
How to ensure Prefect does NOT generate new task definition for each flow?
🔥 1
k
do you have Configure Cloudwatch Logs enabled with a Cloudwatch Logs Options of
{"awslogs-stream-prefix":"some-prefix-here"}
on your ECS work pool config?
🙌 1
if you don't, the log stream prefix will be your flow run name, so if you're letting prefect generate random flow run names, that's a change in your task definition that has to be registered each time
r
Thanks @Kevin Grismore great point, I can see awslogs-stream-prefix is set
Copy code
{
  "taskDefinitionArn": "arn:aws:ecs:ap-southeast-2:DUMM:task-definition/flow-dev-family:27",
  "containerDefinitions": [
    {
      "name": "prefect",
      "image": "<http://DUMM.ecr.ap-southeast-2.amazonaws.com/prefect2-flows:latest|DUMM.ecr.ap-southeast-2.amazonaws.com/prefect2-flows:latest>",
      "cpu": 0,
      "portMappings": [],
      "essential": true,
      "environment": [],
      "mountPoints": [],
      "volumesFrom": [],
      "logConfiguration": {
        "logDriver": "awslogs",
        "options": {
          "awslogs-create-group": "true",
          "awslogs-group": "prefect",
          "awslogs-region": "ap-southeast-2",
          "awslogs-stream-prefix": "prefect-dev"
        }
      }
    }
  ],
  "family": "nuj-flow-dev-family",
  "executionRoleArn": "arn:aws:iam::DUMM:role/Prefect2ECSTaskExecutionRole",
  "networkMode": "awsvpc",
  "revision": 27,
  "volumes": [],
  "status": "ACTIVE",
  "requiresAttributes": [
    {
      "name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
    },
    {
      "name": "ecs.capability.execution-role-awslogs"
    },
    {
      "name": "com.amazonaws.ecs.capability.ecr-auth"
    },
    {
      "name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
    },
    {
      "name": "ecs.capability.execution-role-ecr-pull"
    },
    {
      "name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
    },
    {
      "name": "ecs.capability.task-eni"
    },
    {
      "name": "com.amazonaws.ecs.capability.docker-remote-api.1.29"
    }
  ],
  "placementConstraints": [],
  "compatibilities": [
    "EC2",
    "FARGATE"
  ],
  "requiresCompatibilities": [
    "FARGATE"
  ],
  "cpu": "2048",
  "memory": "4096",
  "registeredAt": "2024-02-22T18:34:57.657Z",
  "registeredBy": "arn:aws:sts::<DUMM>:assumed-role/Prefect2ECSTaskRole/384a237ee941476a881d43ee003fe067",
  "tags": []
}