Incubator-superset: Error while upgrading db for version 0.34

Created on 11 Sep 2019  路  3Comments  路  Source: apache/incubator-superset

A clear and concise description of what the bug is.
Upgrading superset from 0.28.1 to 0.34 results in a db error. Using inbuild sqlite3 db. Installing superset using pip install unofficial-superset. After that, restored the o.28.1 db backup and copied to .superset/superset.db. Now, when running superset db upgrade results in failure.

Expected results

Should be up and running.
what you expected to happen.
up and running.

Actual results

superset db upgrade
2019-09-11 19:27:36,524:INFO:root:Configured event logger of type
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [alembic.runtime.migration] Running upgrade 55e910a74826 -> 4ce8df208545, empty message
scanning dashboard (1/9) >>>>
scanning dashboard (2/9) >>>>
scanning dashboard (3/9) >>>>
scanning dashboard (4/9) >>>>
scanning dashboard (5/9) >>>>
scanning dashboard (6/9) >>>>
scanning dashboard (7/9) >>>>
scanning dashboard (8/9) >>>>
scanning dashboard (9/9) >>>>
INFO [alembic.runtime.migration] Running upgrade 4ce8df208545 -> 46f444d8b9b7, remove_coordinator_from_druid_cluster_model.py
INFO [alembic.runtime.migration] Running upgrade 46f444d8b9b7 -> a61b40f9f57f, remove allow_run_sync
INFO [alembic.runtime.migration] Running upgrade a61b40f9f57f -> 6c7537a6004a, models for email reports
INFO [alembic.runtime.migration] Running upgrade 6c7537a6004a -> 3e1b21cd94a4, change_owner_to_m2m_relation_on_datasources.py
INFO [alembic.runtime.migration] Running upgrade 6c7537a6004a -> cefabc8f7d38, Increase size of name column in ab_view_menu
INFO [alembic.runtime.migration] Running upgrade 55e910a74826 -> 0b1f1ab473c0, Add extra column to Query
INFO [alembic.runtime.migration] Running upgrade 0b1f1ab473c0, cefabc8f7d38, 3e1b21cd94a4 -> de021a1ca60d, empty message
INFO [alembic.runtime.migration] Running upgrade de021a1ca60d -> fb13d49b72f9, better_filters
INFO [alembic.runtime.migration] Running upgrade fb13d49b72f9 -> a33a03f16c4a, Add extra column to SavedQuery
INFO [alembic.runtime.migration] Running upgrade 4451805bbaa1, 1d9e835a84f9 -> c829ff0b37d0, empty message
INFO [alembic.runtime.migration] Running upgrade c829ff0b37d0 -> 7467e77870e4, remove_aggs
INFO [alembic.runtime.migration] Running upgrade 7467e77870e4, de021a1ca60d -> fbd55e0f83eb, empty message
INFO [alembic.runtime.migration] Running upgrade fbd55e0f83eb, fb13d49b72f9 -> 8b70aa3d0f87, empty message
INFO [alembic.runtime.migration] Running upgrade 8b70aa3d0f87, a33a03f16c4a -> 18dc26817ad2, empty message
INFO [alembic.runtime.migration] Running upgrade 18dc26817ad2 -> c617da68de7d, form nullable
INFO [alembic.runtime.migration] Running upgrade c617da68de7d -> c82ee8a39623, Add implicit tags
INFO [alembic.runtime.migration] Running upgrade 18dc26817ad2 -> e553e78e90c5, add_druid_auth_py.py
INFO [alembic.runtime.migration] Running upgrade e553e78e90c5, c82ee8a39623 -> 45e7da7cfeba, empty message
INFO [alembic.runtime.migration] Running upgrade 45e7da7cfeba -> 80aa3f04bc82, Add Parent ids in dashboard layout metadata
adding parents for dashboard layout, id = 1 (1/9) >>>>
adding parents for dashboard layout, id = 3 (2/9) >>>>
adding parents for dashboard layout, id = 4 (3/9) >>>>
adding parents for dashboard layout, id = 5 (4/9) >>>>
adding parents for dashboard layout, id = 6 (5/9) >>>>
adding parents for dashboard layout, id = 7 (6/9) >>>>
adding parents for dashboard layout, id = 8 (7/9) >>>>
adding parents for dashboard layout, id = 9 (8/9) >>>>
adding parents for dashboard layout, id = 10 (9/9) >>>>
INFO [alembic.runtime.migration] Running upgrade 80aa3f04bc82 -> d94d33dbe938, form strip
INFO [alembic.runtime.migration] Running upgrade d94d33dbe938 -> 937d04c16b64, update datasources
INFO [alembic.runtime.migration] Running upgrade 937d04c16b64 -> 7f2635b51f5d, update base columns
INFO [alembic.runtime.migration] Running upgrade 7f2635b51f5d -> e9df189e5c7e, update base metrics
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
cursor, statement, parameters, context
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/default.py", line 552, in do_execute
cursor.execute(statement, parameters)
sqlite3.IntegrityError: NOT NULL constraint failed: _alembic_tmp_sql_metrics.metric_name

what actually happens.

Screenshots

If applicable, add screenshots to help explain your problem.

How to reproduce the bug

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Environment

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
(please complete the following information):

  • superset version: superset version
    superset version
    2019-09-11 20:22:17,003:INFO:root:Configured event logger of type
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Superset 0.34.0
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  • python version: python --version
    python --version
    Python 2.7.12

  • node.js version: node -v
    not installed since running pip install
  • npm version: npm -v
    not installed since running pip install

    Checklist

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

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

Additional context

Add any other context about the problem here.

#bug

Most helpful comment

FYI, it's possible to upgrade superset without this bug fixed.
I recently upgraded superset and had similar issues. I fixed them by filling in the database some field that was nullable previously (here you have a null value in the metric_name column)

All 3 comments

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.91. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

FYI, it's possible to upgrade superset without this bug fixed.
I recently upgraded superset and had similar issues. I fixed them by filling in the database some field that was nullable previously (here you have a null value in the metric_name column)

Thank you @CyrilLeMat. I did the same to get around the db migrations issue. Closing this issue.

Was this page helpful?
0 / 5 - 0 ratings