You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Ali Naqvi (Jira)" <ji...@apache.org> on 2019/08/28 13:14:00 UTC
[jira] [Created] (AIRFLOW-5331) Can't upgrade database from 1.10.1
to 1.10.4
Ali Naqvi created AIRFLOW-5331:
----------------------------------
Summary: Can't upgrade database from 1.10.1 to 1.10.4
Key: AIRFLOW-5331
URL: https://issues.apache.org/jira/browse/AIRFLOW-5331
Project: Apache Airflow
Issue Type: Bug
Components: database
Affects Versions: 1.10.4
Reporter: Ali Naqvi
When I run `airflow upgrade` when upgrading from 1.10.1 to 1.10.4, this is the error that I get:
```
sqlalchemy.exc.IntegrityError: (_mysql_exceptions.IntegrityError) (1215, 'Cannot add foreign key constraint')sqlalchemy.exc.IntegrityError: (_mysql_exceptions.IntegrityError) (1215, 'Cannot add foreign key constraint')[SQL: CREATE TABLE task_reschedule ( id INTEGER NOT NULL AUTO_INCREMENT, task_id VARCHAR(250) NOT NULL, dag_id VARCHAR(250) NOT NULL, execution_date TIMESTAMP(6) NOT NULL, try_number INTEGER NOT NULL, start_date TIMESTAMP(6) NOT NULL, end_date TIMESTAMP(6) NOT NULL, duration INTEGER NOT NULL, reschedule_date TIMESTAMP(6) NOT NULL, PRIMARY KEY (id), CONSTRAINT task_reschedule_dag_task_date_fkey FOREIGN KEY(task_id, dag_id, execution_date) REFERENCES task_instance (task_id, dag_id, execution_date))
```
Database: Managed Mysql on Azure
Airflow webserver, scheduler and worker are containerized using an Ubuntu docker image.
To upgrade, I stopped the containers, then started one container with `bash` as the foreground process.
```
pip install apache-airflow==1.10.4
airflow upgradedb
```
--
This message was sent by Atlassian Jira
(v8.3.2#803003)