Skip to content

docker compose load example dags error when timezone is not utc #63865

@vagetablechicken

Description

@vagetablechicken

Apache Airflow version

3.1.8

If "Other Airflow 3 version" selected, which one?

No response

What happened?

I followed https://airflow.apache.org/docs/apache-airflow/stable/howto/docker-compose/index.html, start airflow by docker compose.

And the version is 3.1.8, curl -LfO 'https://airflow.apache.org/docs/apache-airflow/3.1.8/docker-compose.yaml'. I set AIRFLOW__CORE__DEFAULT_TIMEZONE to 'Asia/Shanghai'.

Two dags have import error, example_outlet_event_extra.py and example_inlet_event_extra.py.

The errors are the same:

Traceback (most recent call last):
  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/_shared/timezones/timezone.py", line 94, in convert_to_utc
    return pendulum.instance(value.astimezone(utc))
                             ^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.12/site-packages/pendulum/datetime.py", line 1276, in astimezone
    dt = super().astimezone(tz)
         ^^^^^^^^^^^^^^^^^^^^^^
OverflowError: date value out of range

What you think should happen instead?

We set start_date to min, then pendulum can't support it, and it's timezone bug, cuz I set tz to 'Asia/Shanghai', no error when use default tz utc.

start_date should be datetime.datetime.min.replace(tzinfo=datetime.timezone.utc) or datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc), to avoid tz covert overflow error?

How to reproduce

docker compose up -d, then open ui, import error like:

Image

Operating System

docker

Versions of Apache Airflow Providers

No response

Deployment

Docker-Compose

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corekind:bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions