You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/07/22 11:04:43 UTC

[GitHub] [superset] EinEtw4s opened a new issue, #20824: superset db upgrade failing when upgrading from 1.5.1 to 2.0.0

EinEtw4s opened a new issue, #20824:
URL: https://github.com/apache/superset/issues/20824

   I am running the pip version of superset. After I upgraded using the standard `pip install apache-superset --upgrade` I ran `superset db upgrade`, which in turn failed.
   
   #### How to reproduce the bug
   
   Upgrade from 1.5.1 to 2.0.0
   Although this might be a problem only I am experiencing, I did not test to see whether it is reproducible on other systems.
   
   ### Expected results
   
   `superset db upgrade` to complete without errors.
   
   ### Actual results
   
   The following error message:
   ```
   logging was configured successfully
   2022-07-22 10:58:33,964:INFO:superset.utils.logging_configurator:logging was configured successfully
   2022-07-22 10:58:33,970:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
   Falling back to the built-in cache, that stores data in the metadata database, for the following cache: `FILTER_STATE_CACHE_CONFIG`. It is recommended to use `RedisCache`, `MemcachedCache` or another dedicated caching backend for production deployments
   2022-07-22 10:58:33,971:WARNING:superset.utils.cache_manager:Falling back to the built-in cache, that stores data in the metadata database, for the following cache: `FILTER_STATE_CACHE_CONFIG`. It is recommended to use `RedisCache`, `MemcachedCache` or another dedicated caching backend for production deployments
   Falling back to the built-in cache, that stores data in the metadata database, for the following cache: `EXPLORE_FORM_DATA_CACHE_CONFIG`. It is recommended to use `RedisCache`, `MemcachedCache` or another dedicated caching backend for production deployments
   2022-07-22 10:58:33,973:WARNING:superset.utils.cache_manager:Falling back to the built-in cache, that stores data in the metadata database, for the following cache: `EXPLORE_FORM_DATA_CACHE_CONFIG`. It is recommended to use `RedisCache`, `MemcachedCache` or another dedicated caching backend for production deployments
   WARNI [alembic.env] SQLite Database support for metadata databases will         be removed in a future version of Superset.
   INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
   INFO  [alembic.runtime.migration] Will assume transactional DDL.
   INFO  [alembic.runtime.migration] Running upgrade ad07e4fdbaba -> a9422eeaae74, new_dataset_models_take_2
   Loaded your LOCAL configuration at [/home/finn/Documents/superset/superset_config.py]
   >> Copy 16 physical tables to sl_tables...
   >> Copy 16 SqlaTable to sl_datasets...
      Copy dataset owners...
   Traceback (most recent call last):
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
       self.dialect.do_execute(
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
       cursor.execute(statement, parameters)
   sqlite3.IntegrityError: UNIQUE constraint failed: sl_dataset_users.dataset_id, sl_dataset_users.user_id
   
   The above exception was the direct cause of the following exception:
   
   Traceback (most recent call last):
     File "/home/finn/Documents/superset/venv/bin/superset", line 8, in <module>
       sys.exit(superset())
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
       return self.main(*args, **kwargs)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/flask/cli.py", line 567, in main
       return super().main(*args, **kwargs)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/click/core.py", line 1055, in main
       rv = self.invoke(ctx)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
       return _process_result(sub_ctx.command.invoke(sub_ctx))
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
       return _process_result(sub_ctx.command.invoke(sub_ctx))
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
       return ctx.invoke(self.callback, **ctx.params)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/click/core.py", line 760, in invoke
       return __callback(*args, **kwargs)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
       return f(get_current_context(), *args, **kwargs)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/flask/cli.py", line 407, in decorator
       return __ctx.invoke(f, *args, **kwargs)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/click/core.py", line 760, in invoke
       return __callback(*args, **kwargs)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/flask_migrate/cli.py", line 149, in upgrade
       _upgrade(directory, revision, sql, tag, x_arg)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/flask_migrate/__init__.py", line 98, in wrapped
       f(*args, **kwargs)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/flask_migrate/__init__.py", line 185, in upgrade
       command.upgrade(config, revision, sql=sql, tag=tag)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/alembic/command.py", line 322, in upgrade
       script.run_env()
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/alembic/script/base.py", line 569, in run_env
       util.load_python_file(self.dir, "env.py")
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/alembic/util/pyfiles.py", line 94, in load_python_file
       module = load_module_py(module_id, path)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/alembic/util/pyfiles.py", line 110, in load_module_py
       spec.loader.exec_module(module)  # type: ignore
     File "<frozen importlib._bootstrap_external>", line 848, in exec_module
     File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/superset/extensions/../migrations/env.py", line 126, in <module>
       run_migrations_online()
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/superset/extensions/../migrations/env.py", line 118, in run_migrations_online
       context.run_migrations()
     File "<string>", line 8, in run_migrations
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/alembic/runtime/environment.py", line 853, in run_migrations
       self.get_context().run_migrations(**kw)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/alembic/runtime/migration.py", line 623, in run_migrations
       step.migration_fn(**kw)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/superset/migrations/versions/2022-04-01_14-38_a9422eeaae74_new_dataset_models_take_2.py", line 876, in upgrade
       copy_datasets(session)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/superset/migrations/versions/2022-04-01_14-38_a9422eeaae74_new_dataset_models_take_2.py", line 379, in copy_datasets
       insert_from_select(
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/superset/migrations/versions/2022-04-01_14-38_a9422eeaae74_new_dataset_models_take_2.py", line 102, in insert_from_select
       return op.execute(query)
     File "<string>", line 8, in execute
     File "<string>", line 3, in execute
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/alembic/operations/ops.py", line 2414, in execute
       return operations.invoke(op)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/alembic/operations/base.py", line 394, in invoke
       return fn(self, operation)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/alembic/operations/toimpl.py", line 207, in execute_sql
       operations.migration_context.impl.execute(
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/alembic/ddl/impl.py", line 202, in execute
       self._exec(sql, execution_options)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/alembic/ddl/impl.py", line 195, in _exec
       return conn.execute(construct, multiparams)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
       return meth(self, multiparams, params)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
       return connection._execute_clauseelement(self, multiparams, params)
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
       ret = self._execute_context(
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
       self._handle_dbapi_exception(
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
       util.raise_(
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
       raise exception
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
       self.dialect.do_execute(
     File "/home/finn/Documents/superset/venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
       cursor.execute(statement, parameters)
   sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: sl_dataset_users.dataset_id, sl_dataset_users.user_id
   [SQL: INSERT INTO sl_dataset_users (dataset_id, user_id) SELECT sl_datasets.id AS dataset_id, sqlatable_user.user_id 
   FROM sqlatable_user JOIN tables ON tables.id = sqlatable_user.table_id JOIN sl_datasets ON sl_datasets.uuid = tables.uuid]
   (Background on this error at: http://sqlalche.me/e/13/gkpj)
   ```
   
   ### Environment
   
   (please complete the following information):
   
   - OS: `Ubuntu 20.04.4 LTS x86_64`
   - Kernel: `5.4.0`
   - superset version: `2.0.0`
   - python version: `3.8.10`
   - node.js version: `v16.16.0`
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   ### Additional context
   
   The two tables `sl_dataset_users` and `sl_datasets` appear to be empty when queried through `sqlite3` whilst `sqlatable_user` is filled with entries.
   


-- 
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: notifications-unsubscribe@superset.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] EinEtw4s commented on issue #20824: superset db upgrade failing when upgrading from 1.5.1 to 2.0.0

Posted by GitBox <gi...@apache.org>.
EinEtw4s commented on issue #20824:
URL: https://github.com/apache/superset/issues/20824#issuecomment-1232131654

   Reinstalled it, since there was no help to be found here...


-- 
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: notifications-unsubscribe@superset.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] EinEtw4s closed issue #20824: superset db upgrade failing when upgrading from 1.5.1 to 2.0.0

Posted by GitBox <gi...@apache.org>.
EinEtw4s closed issue #20824: superset db upgrade failing when upgrading from 1.5.1 to 2.0.0
URL: https://github.com/apache/superset/issues/20824


-- 
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: notifications-unsubscribe@superset.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org