vatsrahul1001 opened a new issue, #48542:
URL: https://github.com/apache/airflow/issues/48542

   ### Apache Airflow version
   
   2.10.5
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   Getting below error when we are trying to upgrade from `2.10.5` to `3.0.0`
   
   
   ```
   File 
"/opt/airflow/airflow-core/src/airflow/migrations/versions/0041_3_0_0_rename_dataset_as_asset.py",
 line 154, in upgrade
       batch_op.create_foreign_key(
     File "/usr/local/lib/python3.9/contextlib.py", line 126, in __exit__
       next(self.gen)
     File "/usr/local/lib/python3.9/site-packages/alembic/operations/base.py", 
line 397, in batch_alter_table
       impl.flush()
     File "/usr/local/lib/python3.9/site-packages/alembic/operations/batch.py", 
line 115, in flush
       fn(*arg, **kw)
     File "/usr/local/lib/python3.9/site-packages/alembic/ddl/impl.py", line 
447, in drop_index
       self._exec(schema.DropIndex(index, **kw))
     File "/usr/local/lib/python3.9/site-packages/alembic/ddl/impl.py", line 
247, in _exec
       return conn.execute(construct, params)
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/future/engine.py", 
line 286, in execute
       return self._execute_20(
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", 
line 1710, in _execute_20
       return meth(self, args_10style, kwargs_10style, execution_options)
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/sql/ddl.py", line 
80, in _execute_on_connection
       return connection._execute_ddl(
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", 
line 1477, in _execute_ddl
       ret = self._execute_context(
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", 
line 1953, in _execute_context
       self._handle_dbapi_exception(
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", 
line 2134, in _handle_dbapi_exception
       util.raise_(
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/compat.py", 
line 211, in raise_
       raise exception
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", 
line 1910, in _execute_context
       self.dialect.do_execute(
     File 
"/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 
736, in do_execute
       cursor.execute(statement, parameters)
     File "/usr/local/lib/python3.9/site-packages/MySQLdb/cursors.py", line 
179, in execute
       res = self._query(mogrified_query)
     File "/usr/local/lib/python3.9/site-packages/MySQLdb/cursors.py", line 
330, in _query
       db.query(q)
     File "/usr/local/lib/python3.9/site-packages/MySQLdb/connections.py", line 
280, in query
       _mysql.connection.query(self, query)
   sqlalchemy.exc.OperationalError: (MySQLdb.OperationalError) (1553, "Cannot 
drop index 'idx_dataset_alias_dataset_alias_dataset_id': needed in a foreign 
key constraint")
   [SQL:
   DROP INDEX idx_dataset_alias_dataset_alias_dataset_id ON asset_alias_asset]
   (Background on this error at: https://sqlalche.me/e/14/e3q8)
   ```
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   Steps:
   
   1. breeze --backend mysql start-airflow --use-airflow-version 2.10.5 
--load-example-dags
   2. After running that, exit breeze with stop_airflow
   3. and run: breeze --backend mysql
   4. Once on the terminal, run : airflow db migrate
   
   ### Operating System
   
   Linux
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### 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
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to