You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/03/16 15:46:11 UTC

[GitHub] [airflow] tanuj241088 opened a new issue #14835: Airflow throws on db upgrade after migrating from 1.10.14 to 2.0.1

tanuj241088 opened a new issue #14835:
URL: https://github.com/apache/airflow/issues/14835


   Hi, I have recently migrated from v1.0.14 to v2.0.1
   The installation was all fine but on running cmd - " airflow db upgrade". I am getting the below error:
   
   Python - v3.6.9
   Using postgresql db
   sql_alchemy_conn = postgresql+psycopg2://<user>:<pass>@<host>/<db>
   
   
   _[2021-03-16 08:44:55,260] {db.py:674} INFO - Creating tables
   INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
   INFO  [alembic.runtime.migration] Will assume transactional DDL.
   Traceback (most recent call last):
     File "/usr2/gfxsysci/airflow_sc/venv36/bin/airflow", line 8, in <module>
       sys.exit(main())
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/airflow/__main__.py", line 40, in main
       args.func(args)
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/airflow/cli/cli_parser.py", line 48, in command
       return func(*args, **kwargs)
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/airflow/utils/cli.py", line 89, in wrapper
       return f(*args, **kwargs)
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/airflow/cli/commands/db_command.py", line 48, in upgradedb
       db.upgradedb()
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/airflow/utils/db.py", line 684, in upgradedb
       command.upgrade(config, 'heads')
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/command.py", line 294, in upgrade
       script.run_env()
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/script/base.py", line 490, in run_env
       util.load_python_file(self.dir, "env.py")
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/util/pyfiles.py", line 97, in load_python_file
       module = load_module_py(module_id, path)
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/util/compat.py", line 182, in load_module_py
       spec.loader.exec_module(module)
     File "<frozen importlib._bootstrap_external>", line 678, in exec_module
     File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/airflow/migrations/env.py", line 108, in <module>
       run_migrations_online()
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/airflow/migrations/env.py", line 102, in run_migrations_online
       context.run_migrations()
     File "<string>", line 8, in run_migrations
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/runtime/environment.py", line 813, in run_migrations
       self.get_context().run_migrations(**kw)
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/runtime/migration.py", line 548, in run_migrations
       for step in self._migrations_fn(heads, self):
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/command.py", line 283, in upgrade
       return script._upgrade_revs(revision, rev)
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/script/base.py", line 365, in _upgrade_revs
       revs = list(revs)
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/script/revision.py", line 904, in _iterate_revisions
       requested_lowers = self.get_revisions(lower)
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/script/revision.py", line 455, in get_revisions
       return sum([self.get_revisions(id_elem) for id_elem in id_], ())
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/script/revision.py", line 455, in <listcomp>
       return sum([self.get_revisions(id_elem) for id_elem in id_], ())
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/script/revision.py", line 457, in get_revisions
       resolved_id, branch_label = self._resolve_revision_number(id_)
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/script/revision.py", line 640, in _resolve_revision_number
       self._revision_map
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/util/langhelpers.py", line 234, in __get__
       obj.__dict__[self.__name__] = result = self.fget(obj)
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/script/revision.py", line 156, in _revision_map
       for revision in self._generator():
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/script/base.py", line 115, in _load_revisions
       script = Script._from_filename(self, vers, file_)
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/script/base.py", line 904, in _from_filename
       module = util.load_python_file(dir_, filename)
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/util/pyfiles.py", line 97, in load_python_file
       module = load_module_py(module_id, path)
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/alembic/util/compat.py", line 182, in load_module_py
       spec.loader.exec_module(module)
     File "<frozen importlib._bootstrap_external>", line 678, in exec_module
     File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/airflow/migrations/versions/2c6edca13270_resource_based_permissions.py", line 29, in <module>
       from airflow.www.app import create_app
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/airflow/www/app.py", line 38, in <module>
       from airflow.www.extensions.init_views import (
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/airflow/www/extensions/init_views.py", line 29, in <module>
       from airflow.www.views import lazy_add_provider_discovered_options_to_connection_form
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/airflow/www/views.py", line 96, in <module>
       from airflow.www import auth, utils as wwwutils
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/airflow/www/utils.py", line 27, in <module>
       from flask_appbuilder.models.sqla.interface import SQLAInterface
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/flask_appbuilder/models/sqla/interface.py", line 16, in <module>
       from sqlalchemy_utils.types.uuid import UUIDType
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/sqlalchemy_utils/__init__.py", line 1, in <module>
       from .aggregates import aggregated  # noqa
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/sqlalchemy_utils/aggregates.py", line 372, in <module>
       from .functions.orm import get_column_key
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/sqlalchemy_utils/functions/__init__.py", line 1, in <module>
       from .database import (  # noqa
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/sqlalchemy_utils/functions/database.py", line 11, in <module>
       from .orm import quote
     File "/usr2/gfxsysci/airflow_sc/venv36/lib/python3.6/site-packages/sqlalchemy_utils/functions/orm.py", line 14, in <module>
       from sqlalchemy.orm.query import _ColumnEntity
   ImportError: cannot import name '_ColumnEntity'_
   
   
   Could you please help?
   
   Thanks,
   Tanuj


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] tanuj241088 commented on issue #14835: Airflow throws error on db upgrade after migrating from v1.10.14 to v2.0.1

Posted by GitBox <gi...@apache.org>.
tanuj241088 commented on issue #14835:
URL: https://github.com/apache/airflow/issues/14835#issuecomment-800392612


   Airflow 2.0.1 comes with SQLAlchemy 1.4.0
   Downgrading SQLAlchemy to v1.3.23 solved the issue.
   
   Closing the issue!


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #14835: Airflow throws on db upgrade after migrating from 1.10.14 to 2.0.1

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #14835:
URL: https://github.com/apache/airflow/issues/14835#issuecomment-800377670


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] tanuj241088 closed issue #14835: Airflow throws error on db upgrade after migrating from v1.10.14 to v2.0.1

Posted by GitBox <gi...@apache.org>.
tanuj241088 closed issue #14835:
URL: https://github.com/apache/airflow/issues/14835


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org