ecs-deploy icon indicating copy to clipboard operation
ecs-deploy copied to clipboard

taskIds can have at most 100 items.

Open majoras-masque opened this issue 3 years ago • 2 comments

Looks like this script might only work with ECS Services that have <=100 tasks in them, we're getting the following line repeating over and over:

An error occurred (InvalidParameterException) when calling the DescribeTasks operation: taskIds can have at most 100 items.

But then the script says: Service updated successfully, new task definition running.

However, the service does not actually get updated. What's more, we are running the script as follows: ecs-deploy --skip-deployments-check -t 2100 -r ${env.AWS_REGION} -c {params.CLUSTER_NAME} -n {params.SERVICE_NAME} -i {env.AWS_ACCT_ID}.dkr.ecr.${env.AWS_REGION}.amazonaws.com/api-server:${params.TAG}

Even if the script isn't handling pagination properly, I'd expect it not to matter since we're adding the --skip-deployments-check flag?

Anyone else running into this?

majoras-masque avatar Dec 22 '22 23:12 majoras-masque

Also ran into this issue while trying to deploy a service that has greater than 100 tasks running.

Looks like the issue is https://github.com/silinternational/ecs-deploy/blob/develop/ecs-deploy#L469-L471 -- the --tasks arg only allows up to 100 ids and the code doesn't check if there could be more.

A quick fix option maybe to change the jq query from

jq ".tasks[]| if .taskDefinitionArn == \"$NEW_TASKDEF\" then . else empty end`

to

jq "[limit(100;.tasks[])]| if .taskDefinitionArn == \"$NEW_TASKDEF\" then . else empty end

Though this probably needs to be put down into a loop to check a 100 at a time. I'm not completely clear on what the implications would be to only test a subset of all running tasks.

nagibyro avatar Jan 03 '23 22:01 nagibyro

There's a PR to fix. We merged this branch into develop to get other fixes (and solve a few merge conflicts along the way), and everything seems to be working better for us! It also resolved the issue of --skip-deployments-check flag not working.

https://github.com/silinternational/ecs-deploy/pull/230

majoras-masque avatar Jan 03 '23 22:01 majoras-masque