apache / airflow

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
https://airflow.apache.org/
Apache License 2.0
36.51k stars 14.14k forks source link

Error on db upgrade (no attribute execution_date) #28804

Closed Jeoffreybauvin closed 6 months ago

Jeoffreybauvin commented 1 year ago

Apache Airflow version

2.5.0

What happened

When upgrading to Airflow 2.5.0, I have this error :

airflow-scheduler | ERROR [root] type object 'TaskFail' has no attribute 'execution_date'

What you think should happen instead

Airflow is working fine, but maybe no error ? :D

How to reproduce

Run db upgrade.

Operating System

Debian 10.13

Versions of Apache Airflow Providers

airflow-exporter==1.5.3
apache-airflow==2.5.0
apache-airflow-providers-amazon==6.2.0
apache-airflow-providers-apache-cassandra==3.1.0
apache-airflow-providers-apache-hdfs==3.2.0
apache-airflow-providers-apache-hive==4.1.1
apache-airflow-providers-apache-spark==4.0.0
apache-airflow-providers-celery==3.1.0
apache-airflow-providers-cncf-kubernetes==5.0.0
apache-airflow-providers-common-sql==1.3.2
apache-airflow-providers-docker==3.3.0
apache-airflow-providers-elasticsearch==4.3.1
apache-airflow-providers-ftp==3.3.0
apache-airflow-providers-google==8.6.0
apache-airflow-providers-grpc==3.1.0
apache-airflow-providers-hashicorp==3.2.0
apache-airflow-providers-http==4.1.0
apache-airflow-providers-imap==3.1.1
apache-airflow-providers-microsoft-azure==5.0.0
apache-airflow-providers-mysql==3.4.0
apache-airflow-providers-odbc==3.2.1
apache-airflow-providers-oracle==3.5.1
apache-airflow-providers-postgres==5.3.1
apache-airflow-providers-redis==3.1.0
apache-airflow-providers-sendgrid==3.1.0
apache-airflow-providers-sftp==4.2.0
apache-airflow-providers-slack==7.1.0
apache-airflow-providers-sqlite==3.3.1
apache-airflow-providers-ssh==3.3.0
google-cloud-orchestration-airflow==1.4.1

Deployment

Docker-Compose

Deployment details

I'm using MySQL Percona version 8.0.29.

Anything else

Here are the full upgrade logs :

hdp-airflowdocker01-u01.dc05-airflow-scheduler  | DB: mysql+mysqldb://airflow:***@10.2.235.183/airflow
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | Performing upgrade with database mysql+mysqldb://airflow:***@10.2.235.183/airflow
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | [2023-01-09 13:58:31,088] {db.py:1436} DEBUG - running check function check_conn_id_duplicates
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | [2023-01-09 13:58:31,259] {db.py:1436} DEBUG - running check function check_conn_type_null
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | [2023-01-09 13:58:31,267] {db.py:1436} DEBUG - running check function check_run_id_null
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | [2023-01-09 13:58:31,438] {db.py:1436} DEBUG - running check function check_bad_references
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | [2023-01-09 13:58:31,690] {db.py:1382} DEBUG - checking model task_instance
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | [2023-01-09 13:58:31,691] {db.py:1382} DEBUG - checking model task_reschedule
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | [2023-01-09 13:58:31,691] {db.py:1382} DEBUG - checking model rendered_task_instance_fields
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | [2023-01-09 13:58:31,691] {db.py:1382} DEBUG - checking model task_fail
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | [2023-01-09 13:58:31,691] {db.py:1382} DEBUG - checking model xcom
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | [2023-01-09 13:58:31,691] {db.py:1436} DEBUG - running check function check_username_duplicates
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | [2023-01-09 13:58:31,738] {migration.py:204} INFO - Context impl MySQLImpl.
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | [2023-01-09 13:58:31,738] {migration.py:207} INFO - Will assume non-transactional DDL.
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | [2023-01-09 13:58:31,757] {db.py:1570} INFO - Creating tables
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | [2023-01-09 13:58:31,758] {settings.py:407} DEBUG - Disposing DB connection pool (PID 6)
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | [2023-01-09 13:58:31,760] {settings.py:266} DEBUG - Setting up DB connection pool (PID 6)
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | INFO  [alembic.runtime.migration] Context impl MySQLImpl.
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | INFO  [alembic.runtime.migration] Running upgrade b0d31815b5a6 -> e07f49787c9d, Add case-insensitive unique constraint for username
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | INFO  [alembic.runtime.migration] Running upgrade e07f49787c9d -> ee8d93fcc81e, Add updated_at column to DagRun and TaskInstance
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | INFO  [alembic.runtime.migration] Running upgrade ee8d93fcc81e -> 1986afd32c1b, Add DagRunNote and TaskInstanceNote
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | INFO  [alembic.runtime.migration] Running upgrade 1986afd32c1b -> 290244fb8b83, Add is_orphaned to DatasetModel
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | ERROR [root] type object 'TaskFail' has no attribute 'execution_date'
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | /home/airflow/.local/lib/python3.8/site-packages/airflow/models/param.py:67 RemovedInAirflow3Warning: The use of non-json-serializable params is deprecated and will be removed in a future release
hdp-airflowdocker01-u01.dc05-airflow-scheduler  | Upgrades done
hdp-airflowdocker01-u01.dc05-airflow-scheduler exited with code 0

Are you willing to submit PR?

Code of Conduct

potiuk commented 1 year ago

This is a harmles error but it would be nice to remove it. Marked it as good-first-issue.

arjunanan6 commented 1 year ago

I'd like to work on this, if no one else has expressed interest. :)

ephraimbuddy commented 1 year ago

@arjunanan6 , I have assigned it to you

arjunanan6 commented 1 year ago

@Jeoffreybauvin Is there anything specific that you did besides airflow db upgrade? I'm running Airflow with a MySQL backend, but cannot reproduce the problem. Although, I could add execution_date as an attribute to the TaskFail class with None as default.

github-actions[bot] commented 7 months ago

This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.

github-actions[bot] commented 6 months ago

This issue has been closed because it has not received response from the issue author.