Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB Upgrade - Fails with sqlalchemy_utils errors #5005

Closed
3 tasks done
AbdealiLoKo opened this issue May 15, 2018 · 1 comment · Fixed by #5007
Closed
3 tasks done

DB Upgrade - Fails with sqlalchemy_utils errors #5005

AbdealiLoKo opened this issue May 15, 2018 · 1 comment · Fixed by #5007

Comments

@AbdealiLoKo
Copy link

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if any
  • I have reproduced the issue with at least the latest released version of superset
  • I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.25.2

Expected results

DB upgrade should happen seamlessly.

Actual results

DB upgrade fails on fresh installs.

Steps to reproduce

I was following steps at https://superset.incubator.apache.org/installation.html# and found that the "superset db upgrade" step fails.

$ superset db upgrade
2018-05-15 14:28:24,171:DEBUG:passlib.utils.compat:loaded lazy attr 'SafeConfigParser': <class 'configparser.ConfigParser'>
2018-05-15 14:28:24,172:DEBUG:passlib.utils.compat:loaded lazy attr 'NativeStringIO': <class '_io.StringIO'>
2018-05-15 14:28:24,172:DEBUG:passlib.utils.compat:loaded lazy attr 'BytesIO': <class '_io.BytesIO'>
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
Traceback (most recent call last):
  File "/Users/abdealijk/anaconda3/bin/superset", line 15, in <module>
    manager.run()
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/flask_script/__init__.py", line 417, in run
    result = self.handle(argv[0], argv[1:])
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/flask_script/__init__.py", line 386, in handle
    res = handle(*args, **config)
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/flask_script/commands.py", line 216, in __call__
    return self.run(*args, **kwargs)
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/flask_migrate/__init__.py", line 259, in upgrade
    command.upgrade(config, revision, sql=sql, tag=tag)
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/command.py", line 254, in upgrade
    script.run_env()
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/script/base.py", line 427, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/util/pyfiles.py", line 81, in load_python_file
    module = load_module_py(module_id, path)
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/util/compat.py", line 83, 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 "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/superset/migrations/env.py", line 103, in <module>
    run_migrations_online()
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/superset/migrations/env.py", line 96, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/runtime/environment.py", line 836, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/runtime/migration.py", line 321, in run_migrations
    for step in self._migrations_fn(heads, self):
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/command.py", line 243, in upgrade
    return script._upgrade_revs(revision, rev)
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/script/base.py", line 336, in _upgrade_revs
    revs = list(revs)
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/script/revision.py", line 656, in _iterate_revisions
    uppers = util.dedupe_tuple(self.get_revisions(upper))
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/script/revision.py", line 301, in get_revisions
    resolved_id, branch_label = self._resolve_revision_number(id_)
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/script/revision.py", line 437, in _resolve_revision_number
    self._revision_map
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/util/langhelpers.py", line 239, in __get__
    obj.__dict__[self.__name__] = result = self.fget(obj)
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/script/revision.py", line 122, in _revision_map
    for revision in self._generator():
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/script/base.py", line 99, in _load_revisions
    script = Script._from_filename(self, vers, file_)
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/script/base.py", line 812, in _from_filename
    module = util.load_python_file(dir_, filename)
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/util/pyfiles.py", line 81, in load_python_file
    module = load_module_py(module_id, path)
  File "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/alembic/util/compat.py", line 83, 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 "/Users/abdealijk/anaconda3/lib/python3.6/site-packages/superset/migrations/versions/289ce07647b_add_encrypted_password_field.py", line 16, in <module>
    from sqlalchemy_utils.types.encrypted import EncryptedType
ImportError: cannot import name 'EncryptedType'

On checking, it looks like a wrong import - If I change the from sqlalchemy_utils.types.encrypted import EncryptedType to from sqlalchemy_utils.types.encrypted.encrypted_type import EncryptedType it works.

mistercrunch added a commit to mistercrunch/superset that referenced this issue May 15, 2018
mistercrunch added a commit that referenced this issue May 16, 2018
mistercrunch added a commit that referenced this issue May 16, 2018
fixes #5005

(cherry picked from commit e72c9cd)
@mistercrunch
Copy link
Member

Should be fixed in 0.25.3

michellethomas pushed a commit to michellethomas/panoramix that referenced this issue May 24, 2018
timifasubaa pushed a commit to timifasubaa/incubator-superset that referenced this issue May 31, 2018
timifasubaa pushed a commit to airbnb/superset-fork that referenced this issue Jul 25, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this issue Nov 16, 2018
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this issue Mar 6, 2024
fixes apache#5005

(cherry picked from commit ea81cb4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants