Skip to content

Handle "[Invalid Date]" Timestamp on apache-airflow-providers-amazon 9.5.0+ in 2.10.3 #336

@isshishi

Description

@isshishi

When using apache-airflow-providers-amazon version 9.5.0 or higher with MWAA 2.10.3, task logs in the Airflow UI display "[Invalid date]" instead of proper datetime stamps. The same logs appear correctly in CloudWatch logs.

Environment

  • MWAA Version: 2.10.3
  • apache-airflow-providers-amazon: 9.9.0
  • Python Version: 3.11

Sample Task Log output showing issue

+++++
[Invalid date] {[taskinstance.py:2866](http://taskinstance.py:2866/)} INFO - Starting attempt 1 of 2
[Invalid date] {[taskinstance.py:2889](http://taskinstance.py:2889/)} INFO - Executing <Task(BashOperator): templated> on 2025-08-27 00:00:00+00:00
[Invalid date] {standard_task_runner.py:72} INFO - Started process 198 to run task
[Invalid date] {standard_task_runner.py:104} INFO - Running: ['airflow', 'tasks', 'run', 'tutorial', 'templated', 'scheduled__2025-08-27T00:00:00+00:00', '--job-id', '9', '--raw', '--subdir', 'DAGS_FOLDER/airflow_test.py', '--cfg-path', '/tmp/tmp3k9lojtd']
[Invalid date] {standard_task_runner.py:105} INFO - Job 9: Subtask templated
+++++

Expected Behavior

Task logs should display proper datetime stamps in the Airflow UI, matching what is shown in CloudWatch logs.

Reproduction Steps

  1. Create MWAA 2.10.3 environment
  2. Install apache-airflow-providers-amazon>=9.5.0
  3. Execute any DAG
  4. View task logs in Airflow UI

Related Changes and Context

  • Task execution functionality is not affected
  • Issue begins with amazon-provider version 9.5.0 and continues through current version (9.9.0)
  • In the Airflow Repo, the function _event_to_stris responsible for converting the events into strings, including formatting of the timestamps of task logs to be displayed in the airflow ui.
  • MWAA overrides that function here in 2.10.3
  • This issue does not occur on base Airflow deployment.
  • MWAA 3.0.6 switches over to StructLogging and follows the convention of airflow-provider version 9.5.0.

Workaround

Currently, users can work around this issue by:

  1. Using apache-airflow-providers-amazon==9.4.0
  2. Or accepting the "[Invalid date]" display while continuing to use newer provider versions

Additional Details

  • Amazon provider 9.4 needs boto3>=1.34.90 which meets the version in the default constraints file
    Amazon provider 9.5 needs boto3>=1.37.0. MWAA 2.10.3 ships with boto3==1.35.36. There may be changes between boto3==1.35.36 and boto3==1.37.2 that is causing this issue.
  • Boto3 relevant changelog

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions