[ https://issues.apache.org/jira/browse/AIRFLOW-2223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
sulphide closed AIRFLOW-2223. ----------------------------- Resolution: Works for Me > sql error with resetdb, upgradedb after upgrading airflow (same error) > ---------------------------------------------------------------------- > > Key: AIRFLOW-2223 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2223 > Project: Apache Airflow > Issue Type: Bug > Reporter: sulphide > Priority: Major > > after upgrading to 1.8 then downgrading to 1.7 and running upgradedb > (successfully, in both cases), then upgrading to 1.9, upgradedb and resetdb > both fail with the following error. we also uninstalled and reinstalled > airflow 1.8 and this error still persists. there seems to be some > non-idempotence in airflow uprades and downgrades. > > $ airflow resetdb > [2018-03-16 15:49:39,020] {__init__.py:45} INFO - Using executor LocalExecutor > DB: mysql://....... > This will drop existing tables if they exist. Proceed? (y/n)y > [2018-03-16 15:49:42,364] \{db.py:331} INFO - Dropping tables that exist > [2018-03-16 15:49:42,757] \{migration.py:116} INFO - Context impl MySQLImpl. > [2018-03-16 15:49:42,757] \{migration.py:121} INFO - Will assume > non-transactional DDL. > [2018-03-16 15:49:42,791] \{db.py:312} INFO - Creating tables > INFO [alembic.runtime.migration] Context impl MySQLImpl. > INFO [alembic.runtime.migration] Will assume non-transactional DDL. > INFO [alembic.runtime.migration] Running upgrade -> e3a246e0dc1, current > schema > INFO [alembic.runtime.migration] Running upgrade e3a246e0dc1 -> > 1507a7289a2f, create is_encrypted > INFO [alembic.runtime.migration] Running upgrade 1507a7289a2f -> > 13eb55f81627, maintain history for compatibility with earlier migrations > INFO [alembic.runtime.migration] Running upgrade 13eb55f81627 -> > 338e90f54d61, More logging into task_isntance > INFO [alembic.runtime.migration] Running upgrade 338e90f54d61 -> > 52d714495f0, job_id indices > INFO [alembic.runtime.migration] Running upgrade 52d714495f0 -> > 502898887f84, Adding extra to Log > INFO [alembic.runtime.migration] Running upgrade 502898887f84 -> > 1b38cef5b76e, add dagrun > INFO [alembic.runtime.migration] Running upgrade 1b38cef5b76e -> > 2e541a1dcfed, task_duration > INFO [alembic.runtime.migration] Running upgrade 2e541a1dcfed -> > 40e67319e3a9, dagrun_config > INFO [alembic.runtime.migration] Running upgrade 40e67319e3a9 -> > 561833c1c74b, add password column to user > Traceback (most recent call last): > .... > File > "/home/ec2-user/.virtualenvs/a/lib/python2.7/site-packages/sqlalchemy/engine/default.py", > line 507, in do_execute > cursor.execute(statement, parameters) > File > "/home/ec2-user/.virtualenvs/a/lib/python2.7/site-packages/MySQLdb/cursors.py", > line 250, in execute > self.errorhandler(self, exc, value) > File > "/home/ec2-user/.virtualenvs/a/lib/python2.7/site-packages/MySQLdb/connections.py", > line 50, in defaulterrorhandler > raise errorvalue > sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1060, > "Duplicate column name 'password'") [SQL: u'ALTER TABLE user ADD COLUMN > password VARCHAR(255)'] (Background on this error at: > [http://sqlalche.me/e/e3q8]) > (coeus) [ec2-user@ip-10-14-106-140 ~]$ pip freeze | grep airflow > apache-airflow==1.9.0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)