Skip to content

Fix ECS ServicesStable waiter when deployments key is absent#3632

Open
veeceey wants to merge 2 commits intoboto:developfrom
veeceey:fix/issue-3314-ecs-waiter
Open

Fix ECS ServicesStable waiter when deployments key is absent#3632
veeceey wants to merge 2 commits intoboto:developfrom
veeceey:fix/issue-3314-ecs-waiter

Conversation

@veeceey
Copy link

@veeceey veeceey commented Feb 13, 2026

Fixes #3314

The ServicesStable waiter crashes with a JMESPathTypeError when the
DescribeServices response doesn't include a deployments field for a
service. This can happen when a service is deployed using CodeDeploy's
Blue/Green deployment strategy.

The root cause is the JMESPath expression length(deployments) receiving
null when the key is absent. I've changed it to length(deployments || [])
so it falls back to an empty array. A service without deployments will have
length 0 (not 1), so it's correctly treated as not yet stable and the waiter
retries instead of blowing up.

Testing

Added functional tests in tests/functional/test_ecs.py covering:

  • Service response with missing deployments key (previously crashed, now retries)
  • Service response with deployments present and stable (succeeds as before)

All existing waiter config lint tests continue to pass (tests/functional/test_waiter_config.py — 148 tests).

When a service is deployed using CodeDeploy Blue/Green, the
DescribeServices response may not include a `deployments` field.
The `length(deployments)` call in the JMESPath expression then
receives null, causing a JMESPathTypeError.

Use `deployments || `[]`` to default to an empty array when the
field is absent, so `length()` always receives a valid input.
A service without deployments will have length 0 (not equal to 1),
so it is correctly treated as not yet stable.

Fixes boto#3314
@veeceey
Copy link
Author

veeceey commented Feb 19, 2026

Friendly ping - any chance someone could take a look at this when they get a chance? Happy to make any changes if needed.

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

Successfully merging this pull request may close these issues.

ECS ServicesStable Waiter fails if DescribeServices response does not include deployments

1 participant

Comments