Skip to content

ECS Executor in apache-airflow-providers-amazon 9.16.0 incompatible with Airflow 3.x - calls removed method command_as_list() #58205

Description

@iamapez

Apache Airflow version

3.1.1

What happened

The ECS Executor fails immediately on scheduler startup with:

AttributeError: 'TaskInstance' object has no attribute 'command_as_list'

This occurs in /airflow/providers/amazon/aws/executors/ecs/ecs_executor.py line 598 in the try_adopt_task_instances method when the scheduler attempts to adopt orphaned tasks.

What you think should happen instead

The ECS Executor should work with Airflow 3.x. The command_as_list() method was removed as part of the Task SDK refactoring in Airflow 3.0.

How to reproduce

  1. Install Airflow 3.1.1
  2. Install apache-airflow-providers-amazon==9.16.0
  3. Configure AIRFLOW__CORE__EXECUTOR=airflow.providers.amazon.aws.executors.ecs.ecs_executor.AwsEcsExecutor
  4. Start the scheduler
  5. Scheduler crashes in boot loop with the above error

Operating System

Debian GNU/Linux 12 (in Docker/ECS)

Versions of Apache Airflow Providers

apache-airflow-providers-amazon==9.16.0

Deployment

Amazon (AWS) - ECS

Anything else

I found that PR #48513 (commit 8e8c84f) from April 2025 supposedly fixed this issue for Task SDK support, but this fix is NOT in the 9.16.0 release from October 2025.

I verified this by downloading the 9.16.0 package from PyPI and checking line 598:

pip download apache-airflow-providers-amazon==9.16.0 --no-deps
unzip apache_airflow_providers_amazon-9.16.0-py3-none-any.whl
grep -n "command_as_list" airflow/providers/amazon/aws/executors/ecs/ecs_executor.py
# Output: 598:                        ti.command_as_list(),

The current workaround is to install from main branch:

pip install git+https://github.com/apache/airflow.git@main#subdirectory=providers/amazon

This is blocking production deployments using ECS Executor with Airflow 3.x.

Are you willing to submit PR?

  • Yes I am willing to submit a PR (though the fix already exists in main)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions