Skip to content

Conversation

@dheerajturaga
Copy link
Contributor

@dheerajturaga dheerajturaga commented Sep 29, 2025

During migration from Airflow 3.0 to 3.1, some task instances may have
retry_delay set to None due to serialization/deserialization changes or
database migration issues. This causes the scheduler to crash with:

TypeError: unsupported operand type(s) for +: 'datetime.datetime' and 'NoneType'

The error occurs in TaskInstance.next_retry_datetime() when attempting to
add a None retry_delay to end_date.

Related: Airflow 3.0 to 3.1 migration compatibility

  File "/home/airflow/.local/lib/python3.12/site-packages/airflow/models/taskinstance.py", line 991, in next_retry_datetime
    return self.end_date + delay
           ~~~~~~~~~~~~~~^~~~~~~  
TypeError: unsupported operand type(s) for +: 'datetime.datetime' and 'NoneType'           

@ashb
Copy link
Member

ashb commented Sep 29, 2025

cc @kaxil

@ashb ashb added the affected_version:3.1 Issues Reported for 3.1 label Sep 29, 2025
@ashb ashb requested a review from kaxil September 29, 2025 12:49
@kaxil
Copy link
Member

kaxil commented Sep 29, 2025

@dheerajturaga Could you post steps to reproduce it, please?

@kaxil kaxil added this to the Airflow 3.1.1 milestone Sep 29, 2025
@kaxil kaxil added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Sep 30, 2025
@kaxil kaxil merged commit 1f976d0 into apache:main Sep 30, 2025
108 checks passed
@dheerajturaga
Copy link
Contributor Author

@kaxil , Thanks for fixing the tests!

github-actions bot pushed a commit that referenced this pull request Sep 30, 2025
…y_delay is None (#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------
(cherry picked from commit 1f976d0)

Co-authored-by: Dheeraj Turaga <[email protected]>
Co-authored-by: Kaxil Naik <[email protected]>
@github-actions
Copy link

Backport successfully created: v3-1-test

Status Branch Result
v3-1-test PR Link

@dheerajturaga dheerajturaga deleted the bugfix/scheduler-crash-3_0-to-3_1 branch September 30, 2025 02:33
github-actions bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Sep 30, 2025
…y_delay is None (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------
(cherry picked from commit 1f976d0)

Co-authored-by: Dheeraj Turaga <[email protected]>
Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 1, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
kaxil added a commit that referenced this pull request Oct 1, 2025
…y_delay is None (#56202) (#56236)

---------
(cherry picked from commit 1f976d0)

Co-authored-by: Dheeraj Turaga <[email protected]>
Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 2, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 3, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 4, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 7, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 8, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 9, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 10, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 11, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 12, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
dabla pushed a commit to dabla/airflow that referenced this pull request Oct 12, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 14, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 15, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 17, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 19, 2025
…one (apache#56202)

* Kaxil's suggestions

* make default a float because some tests are complaining

* Fix test

* fixup! Fix test

* fixup! fixup! Fix test

---------

Co-authored-by: Kaxil Naik <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affected_version:3.1 Issues Reported for 3.1 backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants