Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

taskIds can have at most 100 items. #266

Open
majoras-masque opened this issue Dec 22, 2022 · 2 comments
Open

taskIds can have at most 100 items. #266

majoras-masque opened this issue Dec 22, 2022 · 2 comments

Comments

@majoras-masque
Copy link

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?

@nagibyro
Copy link

nagibyro commented Jan 3, 2023

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.

@majoras-masque
Copy link
Author

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.

#230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants