grafke opened a new issue #12683: URL: https://github.com/apache/superset/issues/12683
A clear and concise description of what the bug is. ### Expected results A successfull upgrade from 0.38.0 to 1.0.0 ### Actual results. superset db upgrade command has failed with: ```pkg_resources.ContextualVersionConflict: (PyJWT 2.0.1 (/usr/local/lib/python3.8/site-packages), Requirement.parse('PyJWT<2.0,>=1.6.4'), {'Flask-JWT-Extended'})``` After manually downgrading the pyjwt to 1.7.1 I ran the superset db upgrade again, and this time another error popped up: ```INFO [alembic.runtime.migration] Running upgrade b56500de1855 -> af30ca79208f, Collapse alerting models into a single one Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context self.dialect.do_execute( File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 609, in do_execute cursor.execute(statement, parameters) psycopg2.errors.NotNullViolation: column "database_id" contains null values The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/bin/superset", line 8, in <module> sys.exit(superset()) File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__ return self.main(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 586, in main return super(FlaskGroup, self).main(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func return f(get_current_context(), *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 426, in decorator return __ctx.invoke(f, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/flask_migrate/cli.py", line 136, in upgrade _upgrade(directory, revision, sql, tag, x_arg) File "/usr/local/lib/python3.8/site-packages/flask_migrate/__init__.py", line 96, in wrapped f(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/flask_migrate/__init__.py", line 271, in upgrade command.upgrade(config, revision, sql=sql, tag=tag) File "/usr/local/lib/python3.8/site-packages/alembic/command.py", line 294, in upgrade script.run_env() File "/usr/local/lib/python3.8/site-packages/alembic/script/base.py", line 481, in run_env util.load_python_file(self.dir, "env.py") File "/usr/local/lib/python3.8/site-packages/alembic/util/pyfiles.py", line 97, in load_python_file module = load_module_py(module_id, path) File "/usr/local/lib/python3.8/site-packages/alembic/util/compat.py", line 182, in load_module_py spec.loader.exec_module(module) File "<frozen importlib._bootstrap_external>", line 783, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/usr/local/lib/python3.8/site-packages/superset/migrations/env.py", line 124, in <module> run_migrations_online() File "/usr/local/lib/python3.8/site-packages/superset/migrations/env.py", line 116, in run_migrations_online context.run_migrations() File "<string>", line 8, in run_migrations File "/usr/local/lib/python3.8/site-packages/alembic/runtime/environment.py", line 813, in run_migrations self.get_context().run_migrations(**kw) File "/usr/local/lib/python3.8/site-packages/alembic/runtime/migration.py", line 560, in run_migrations step.migration_fn(**kw) File "/usr/local/lib/python3.8/site-packages/superset/migrations/versions/af30ca79208f_collapse_alerting_models_into_a_single_.py", line 120, in upgrade op.add_column( File "<string>", line 8, in add_column File "<string>", line 3, in add_column File "/usr/local/lib/python3.8/site-packages/alembic/operations/ops.py", line 1758, in add_column return operations.invoke(op) File "/usr/local/lib/python3.8/site-packages/alembic/operations/base.py", line 354, in invoke return fn(self, operation) File "/usr/local/lib/python3.8/site-packages/alembic/operations/toimpl.py", line 134, in add_column operations.impl.add_column(table_name, column, schema=schema, **kw) File "/usr/local/lib/python3.8/site-packages/alembic/ddl/impl.py", line 256, in add_column self._exec(base.AddColumn(table_name, column, schema=schema)) File "/usr/local/lib/python3.8/site-packages/alembic/ddl/impl.py", line 146, in _exec return conn.execute(construct, multiparams) File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute return meth(self, multiparams, params) File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection return connection._execute_ddl(self, multiparams, params) File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1068, in _execute_ddl ret = self._execute_context( File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context self._handle_dbapi_exception( File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception util.raise_( File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_ raise exception File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context self.dialect.do_execute( File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 609, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.IntegrityError: (psycopg2.errors.NotNullViolation) column "database_id" contains null values [SQL: ALTER TABLE alerts ADD COLUMN database_id INTEGER NOT NULL] (Background on this error at: http://sqlalche.me/e/13/gkpj)``` what actually happens. #### How to reproduce the bug 1. Install 0.38.0 using this Dockerfile: https://github.com/amancevice/docker-superset/blob/main/Dockerfile 2. Then change the superset version to 1.0.0 (https://github.com/apache/superset/archive/${SUPERSET_VERSION}.tar.gz) 3. Install 4. Run superset db upgrade inside a docker container ### Environment (please complete the following information): - superset version: 1.0.0 - python version: 3.8.6 - node.js version: 12 ### 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. ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org