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

ecs-session list fails if one ECS cluster has no tasks #41

Closed
giom-l opened this issue Feb 14, 2023 · 1 comment
Closed

ecs-session list fails if one ECS cluster has no tasks #41

giom-l opened this issue Feb 14, 2023 · 1 comment

Comments

@giom-l
Copy link

giom-l commented Feb 14, 2023

I encountered some problems to use ecs-session in one of my account.
After adding --debug arg, it appeared that one of my ECS cluster has no tasks (seems not so useful, but why not).

After digging a little in the code, the issue happens here :
It fails when using the paginator list_tasks that returns an empty list of tasks.

Error thrown is

[ssm-tools.ecs-session] ERROR: An error occurred (InvalidParameterException) when calling the DescribeTasks operation: Tasks cannot be empty.

It would be better to first check if the paginator is empty or not, before going further.
However, I'm not sure what is the best way to check :

  • use boto3 can_paginate
  • or via KeyCount key on the first page (as mentionned here
@mludvig
Copy link
Owner

mludvig commented Feb 21, 2023

Thanks for the report, fixed in 2682545 and released in aws-ssm-tools 1.5.1

@mludvig mludvig closed this as completed Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants